Spring Cloud Stream Fishtown.RC1 /2.1.0.RC1 Release Announcement

Engineering | Oleg Zhurakousky | October 30, 2018 | ...

We are pleased to announce the first Release Candidate of the Spring Cloud Stream Fishtown release train - Fishtown.RC1/2.1.0.RC1.

Spring Cloud Stream Fishtown 2.1.0.RC1 is available for use in the Spring Milestone repository.

The following section provides a brief summary of features and improvements included in this release.

Notable Dependency Upgrades

  • Spring Boot 2.1.0.RC1
  • Reactor Californium.RELEASE
  • Spring Cloud Function 2.1.0.RC1

Spring Cloud Function support

The main theme for this release is the introduction of a new programming model which uses Spring Cloud Function as an alternative for defining stream handlers and sources which can now be expressed as beans of type java.util.function.[Supplier/Function/Consumer]

To specify which functional bean to bind to the external destination(s) exposed by the bindings, you must provide spring.cloud.stream.function.definition property.

Here is the example of the Processor application exposing message handler as java.util.function.Function

@SpringBootApplication
@EnableBinding(Processor.class)
public class MyFunctionBootApp {

	public static void main(String[] args) {
		SpringApplication.run(MyFunctionBootApp.class, 
                  "--spring.cloud.stream.function.definition=toUpperCase");
	}

	@Bean
	public Function<String, String> toUpperCase() {
		return s -> s.toUpperCase();
	}
}

In the above you we simply define a bean of type java.util.function.Function called toUpperCase and identify it as a bean to be used as message handler whose input and output will be bound to the external destinations exposed by the Processor binding.

Function composition

Using this programming model you can also benefit from functional composition where you can dynamically compose complex handlers from a set of simple functions. As an example add the following function bean to the application defined above

@Bean
public Function<String, String> wrapInQuotes() {
	return s -> "\"" + s + "\"";
}

and modify the spring.cloud.stream.function.definition property to reflect your intention to compose a new function from both toUpperCase and wrapInQuotes. To do so Spring Cloud Function allows you to use | (pipe) symbol. So to finish our example our property will now look like this:

--spring.cloud.stream.function.definition=toUpperCase|wrapInQuotes

Other Notable Features, Improvements & enhancements

Core

  • Improvements and enhancements around multi-binder scenarios
  • Major improvements around the treatment of the default vs. binding-specific configuration properties (spans core, rabbit and kafka binders)

Aside form changes and improvements in M1 and M2, here is the list of improvements for this release

Rabbit Binder

Aside form changes and improvements in M1 and M2, here is the list of improvements for this release

Kafka Binder

Aside form changes and improvements in M1 and M2, here is the list of improvements for this release

Quality improvements

As part of the continuing efforts to improve the code quality and to evaluate the framework components for its contract correctness, we have a new Acceptance Test project to bootstrap Spring Cloud Stream applications on Cloud Foundry and Kubernetes. These tests run multiple times in a day on a freshly repaved environment. We hope this provides a foundation for the community and customers to build more automation pipelines on target platforms.

Kinesis Binder

With this release we also want to highlight the recently released Kinesis Binder

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 (which may be ok since it would include all the work from M2):

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

Next Steps

The RC2 is planned in few weeks and then Fishtown.RELEASE.

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

Get the Spring newsletter

Thank you for your interest. Someone will get back to you shortly.

Get ahead

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

Learn more

Get support

Tanzu Spring Runtime 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