Spring Team
Dave Syer

Dave Syer

Senior Consulting Engineer

London

Founder of Spring Cloud, Spring Boot, Spring Batch, lead of Spring Security OAuth, and an active contributor to Spring Integration, Spring Framework, Spring AMQP, Spring Security. Experienced, delivery-focused architect and development manager. Has designed and built successful enterprise software solutions using Spring, and implemented them in major institutions worldwide.
Blog Posts by Dave Syer

Spring Cloud Function 2.0 and Azure Functions

Spring Cloud Function has had support for Microsoft Azure Functions since version 1.0, but in the latest 2.0 releases (still in milestone phase) we decided to change the programming model a bit. This article describes what the changes mean for users, and provides a bit of background behind the shift. We in the Spring team had a lot of fun working on this and collaborating with the folks at Microsoft to get the best blend of the two technologies for our users.

Azure Functions for Java

Microsoft has had Java support in Azure Functions for a while, and it enables developers to easily write and deploy Java code that connects in a serverless way to a wide range of platform services (events, databases, storage, HTTP gateways, etc.) in Azure. It comes with an annotation-based programming model that puts the function implementations in Java methods. So you write a method and annotation it with @FunctionName, and it becomes an Azure Function. There is a rich set of tools based on a Maven plugin (currently) that drives the Azure command line and can be used to build a function, run and debug it locally and deploy it to the cloud. There is a Quickstart Guide on the Azure website which will help you get all the pre-requisites installed and working, and there is more detailed documentation about how Azure Functions works in the Developer’s Guide.

Read more...

The Joy of Mustache: Server Side Templates for the JVM

I don’t do much server-side templating, but when I do…​ well frankly, I tend to forget things. Every template language has its strengths and weaknesses, and they all have syntax to remember, and more frequently to forget. Recently I completed some work on the old Spring Petclinic, converting it to use Thymeleaf in the view layer, and re-organizing the code to be a bit more "modern". I enjoyed working with Thymeleaf 3, and found it a pleasant experience, but had to spend a lot of time scanning documentation and samples. Then I had another little project that needed some templates, and I remembered my fondness for Mustache, which we added to Spring Boot back in version 1.2, and which plays an important role in the excellent Spring REST Docs tool. I added spring-boot-starter-mustache to my new project, and was up and running within seconds.

Read more...

Notes on Reactive Programming Part III: A Simple HTTP Server Application

In this article we continue the series on Reactive Programming, and the focus is less on learning the basic APIs and more on more concrete use cases and writing code that actually does something useful. We will see how Reactive is a useful abstraction for concurrent programming, but also that it has some very low level features that we should learn to treat with respect and caution. If we start to use these features to their full potential we can take control of layers in our application that previously were invisible, hidden by containers, platforms and frameworks.

Read more...

Notes on Reactive Programming Part II: Writing Some Code

In this article we continue the series on Reactive Programming, and we concentrate on explaining some concepts through actual code samples. The end result should be that you understand a bit better what makes Reactive different, and what makes it functional. The examples here are quite abstract, but they give you a way to think about the APIs and the programming style, and start to get a feel for how it is different. We will see the elements of Reactive, and learn how to control the flow of data, and process in background threads if necessary.

Read more...

Notes on Reactive Programming Part I: The Reactive Landscape

Reactive Programming is interesting (again) and there is a lot of noise about it at the moment, not all of which is very easy to understand for an outsider and simple enterprise Java developer, such as the author. This article (the first in a series) might help to clarify your understanding of what the fuss is about. The approach is as concrete as possible, and there is no mention of "denotational semantics". If you are looking for a more academic approach and loads of code samples in Haskell, the internet is full of them, but you probably don’t want to be here.

Read more...

Spring Cloud Brixton.RC2 now available

The latest milestone version of Spring Cloud is “Brixton.RC2” and it is available now from the usual repositories (details in the home page). This is a bugfix release building on the RC1, and there are no notable new features. If all goes well we’d like to get to a RELEASE in a week or two.

Read more...

Overriding Dependency Versions with Spring Boot

This article explains some of the dependency management tricks that
can be used to create libraries and apps that depend on newer versions
of a transitive dependency than that managed by a platform like
Spring Boot or the
Spring IO Platform. The
examples below uses Reactor as an example
of such a dependency because it is nearing a major new release (2.5.0)
but existing dependency management platforms (Spring Boot 1.3.xq)
declare a dependency on older versions (2.0.7). If you wanted to write
an app that depended on a new version of Reactor through a transitive
dependency on a library, this is the situation you would be faced
with.

Read more...

Spring Boot Memory Performance

It has sometimes been suggested that Spring and Spring Boot are “heavyweight”, perhaps just because they allow apps to punch above their weight, providing a lot of features for not very much user code. In this article we concentrate on memory usage and ask if we can quantify the effect of using Spring? Specifically we would like to know more about the real overhead of using Spring compared to other JVM applications. We start by creating a basic application with Spring Boot, and look at a few different ways to measure it when it is running. Then we look at some comparison points: plain Java apps, apps that use Spring but not Spring Boot, an app that uses Spring Boot but no autoconfiguration, and some Ratpack sample apps.

Read more...

Migrating OAuth2 Apps from Spring Boot 1.2 to 1.3

There are some new features in Spring Boot 1.3 to do with OAuth2 clients and servers and Spring Security OAuth2. Some of those features were ported from Spring Cloud Security and hence were in the Angel release train of Spring Cloud, but are not in the Brixton release train. This article helps you navigate the changes and update any existing apps to use the new features.

Dependency Management

If you are not using Spring Cloud you should be able to just change the version number of your Spring Boot dependency. Since some of the OAuth2 features migrated from Spring Cloud Security to Spring Boot in 1.3, it is likely that things are slightly more complicated than that. A separate article deals with upgrading Spring Cloud apps from Spring Boot 1.2 to 1.3. If you are using the Spring Cloud Angel release train then you should consult that article for details of how to manage the dependencies (independent of any specific features).

Read more...

Migrating Spring Cloud Apps from Spring Boot 1.2 to 1.3

There are some interesting new features in Spring Boot 1.3 that are now available in Spring Cloud in the Brixton release train. The Angel release train of Spring Cloud is partly incompatible with Spring Boot 1.3, so when you upgrade there are some important things to be aware of. This article helps you navigate the changes and update any existing apps to use the new features. It should also be helpful generally when trying to adopt new versions of Spring projects into existing codebases.

TIP: You can use mvn dependency:tree or gradle dependencies to list the dependencies in your project and check the versions.

Read more...