Copyright © 2013-2020 Pivotal Software, Inc.
Table of Contents
This section will provide you with a detailed overview of the out of hte box Spring Cloud Stream Applications. It assumes familiarity with general Spring Cloud Stream concepts, which can be found in the Spring Cloud Stream reference documentation.
These Spring Cloud Stream Applications provide you with out-of-the-box Spring Cloud Stream utility applications that you can run independently or with Spring Cloud Data Flow.
You can find a detailed listing of all the applications and their options in the corresponding section of this guide.
Out-of-the-box applications are Spring Boot applications that include a Binder implementation on top of the basic logic of the app (a function for e.g.) - a fully functional uber-jar. These uber-jar’s include minimal code required to execute standalone. For each function application, the project provides a prebuilt version for Apache Kafka and Rabbit MQ Binders.
Prebuilt applications are generated according to the stream apps generator maven plugin.
Based on their target application type, they can be either:
The prebuilt applications follow a naming convention:
<functionality>-<type>-<binder>. For example,
rabbit-sink-kafka is a Rabbit sink using the Kafka binder that is running with Kafka as the middleware.
Core functionality of the apps are available as functions. They are provided as Maven artifacts in the Spring repositories. You can add them as dependencies to your application, as follows:
<dependency> <groupId>io.pivotal.java.function</groupId> <artifactId>jdbc-supplier</artifactId> <version>1.0.0.BUILD-SNAPSHOT</version> </dependency>
Prebuilt applications are available as Maven artifacts. You can download the executable jar artifacts from the Spring Maven repositories. The root directory of the Maven repository that hosts release versions is repo.spring.io/release/org/springframework/cloud/stream/app/. From there you can navigate to the latest released version of a specific app, for example log-sink-rabbit-2.0.2.RELEASE.jar. Use the Milestone and Snapshot repository locations for Milestone and Snapshot executable jar artifacts.
The Docker versions of the applications are available in Docker Hub, at
Naming and versioning follows the same general conventions as Maven, e.g.
docker pull springcloudstream/cassandra-sink-kafka
will pull the latest Docker image of the Cassandra sink with the Kafka binder.
You can build the project and generate the artifacts (including the prebuilt applications) on your own. This is useful if you want to deploy the artifacts locally or add additional features.
First, you need to generate the prebuilt applications. This is done by running the application generation Maven plugin. You can do so by simply invoking the maven build. If you are at the root of the repository, [steam-applications](github.com/spring-cloud-stream-app-starters/stream-applications), then doing a maven build will generate the entire binder based apps. If you don’t want to do that and instead only are interested in a certain app, then cd into the right module and invoke the build from there.
mvn clean package
This will generate the apps. By default, the generated projects are placed under a directory called
There you can find the binder based applications which you can then build and run.
If you’re looking to patch the pre-built applications to accommodate the addition of new dependencies, you can use the following example as the reference.
Let’s review the steps to add
mysql driver to
processor-apps-generator. Find the module that you want to patch and make the changes. For e.g. add the following to the generator plugin’s configuration in the pom.xml
<dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.37</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream-binder-rabbit</artifactId> </dependency> </dependencies>
A source application that listens for HTTP requests and emits the body as a message payload.
If the Content-Type matches
application/json, the payload will be a String,
otherwise the payload will be a byte array.
If content type matches
If content type does not match
The http source supports the following configuration properties:
This source polls data from an RDBMS.
This source is fully based on the
DataSourceAutoConfiguration, so refer to the Spring Boot JDBC Support for more information.
jdbc.split == true(default) and
The jdbc source has the following options:
embedded, possible values:
The time source will simply emit a String with the current time every so often.
The time source has the following options:
Unresolved directive in processors.adoc - include::https://raw.githubusercontent.com/spring-cloud-stream-app-starters/stream-applications/master/processor-app-generator/splitter-processor-apps-generator/README.adoc[tags=ref-doc]
Unresolved directive in sinks.adoc - include::https://raw.githubusercontent.com/spring-cloud-stream-app-starters/stream-applications/master/sink-apps-geneartor/rabbit-sink-apps-generator/README.adoc[tags=ref-doc]
log sink uses the application logger to output the data for inspection.
Please understand that
log sink uses type-less handler, which affects how the actual logging will be performed.
This means that if the content-type is textual, then raw payload bytes will be converted to String, otherwise raw bytes will be logged.
Please see more info in the user-guide.
The log sink has the following options:
<none>, possible values:
Spring Cloud is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.
Before we accept a non-trivial patch or pull request we will need you to sign the contributor’s agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.
eclipse-code-formatter.xmlfile from the Spring Cloud Build project. If using IntelliJ, you can use the Eclipse Code Formatter Plugin to import the same file.
.javafiles to have a simple Javadoc class comment with at least an
@authortag identifying you, and preferably at least a paragraph on what the class is for.
.javafiles (copy from existing files in the project)
@authorto the .java files that you modify substantially (more than cosmetic changes).
Fixes gh-XXXXat the end of the commit message (where XXXX is the issue number).