Spring Cloud Stream Germantown.M1 /2.2.0.M1 Release Announcement

Engineering | Oleg Zhurakousky | March 26, 2019 | ...

We are pleased to announce the first Milestone of the Spring Cloud Stream Germantown release train - Germantown.M1/2.2.0.M1.

Spring Cloud Stream Germantown 2.2.0.M1 is available for use in the Spring Milestone repository.

Some of the highlights:

Improved Home page and User Documentation

Please check out our new home page and user guide

Further functional programming enhancements

We've added additional functional programming enhancements and simplifications where you no longer required to provide @EnableBinding annotation and in some cases you may not need spring.cloud.stream.definition` property. Consider the following:

@SpringBootApplication
public class SimpleFunctionRabbitDemoApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(SimpleFunctionRabbitDemoApplication.class);
    }

    @Bean
    public Function<String, String> echo() {
        return v -> v;
    }
}

Without any additional property and/or annotation the above is a fully functioning Spring Cloud Stream application bound as Processor based on what framework was able to determine from the above code. Subsequently the following would be bound as Sink:

@SpringBootApplication
public class SimpleFunctionRabbitDemoApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(SimpleFunctionRabbitDemoApplication.class);
    }

    @Bean
    public Consumer<String> log() {
        return System.out::println;
    }
}

Notice there is no longer @EnableBinding annotation nor spring.cloud.stream.function.definition property as the framework was able to determine the intention given that there is only one functional bean available in the application context. In the event there are more then one and/or if you want to compose function from several, you can still provide spring.cloud.stream.function.definition property

Functional Kafka Streams

Keeping with the spirit of the main theme that we are driving in Germantown, the Kafka Streams binder also now supports writing applications using a functional programming model. Instead of using StreamListener and SendTo for composing your processors, you can simply define beans of type java.util.Function|Consumer and the binder will delegate to appropriate bindings. This feature is still evolving in Kafka Streams binder and watch this space for more improvements, details and sample applications as we progress through further milestones of Germantown.

Retry template per binding

Ability to configure RetryTemplate per binding.

Numerous enhancements and bug fixes.

NOTE:

If the applications are created from Spring Initializr, they need to add this BOM snippet in maven dependency management before the spring-cloud BOM declaration, otherwise you'll end up with the latest snapshot:

<dependency>
           <groupId>org.springframework.cloud</groupId>
           <artifactId>spring-cloud-stream-dependencies</artifactId>
           <version>Germantown.M1</version>
           <type>pom</type>
           <scope>import</scope>
</dependency>

Also, please keep an eye on one of our newest AWS Kinesis binder which was just released v1.1.0.

Next Steps

As always, we welcome feedback and contributions, so please reach out to us on Stackoverflow or GitHub or via Gitter.

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all