Spring Cloud Stream Reference Guide

Authors

Sabby Anandan, Marius Bogoevici, Eric Bottard, Mark Fisher, Ilayaperumal Gopinathan, Gunnar Hillert, Mark Pollack, Patrick Peralta, Glenn Renfro, Thomas Risberg, Dave Syer, David Turanski, Janne Valkealahti, Benjamin Klein, Soby Chacko, Vinicius Carvalho

Elmhurst.RC1

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Table of Contents

I. Spring Cloud Stream Core
1. Introducing Spring Cloud Stream
2. Main Concepts
2.1. Application Model
2.1.1. Fat JAR
2.2. The Binder Abstraction
2.3. Persistent Publish-Subscribe Support
2.4. Consumer Groups
2.5. Consumer Types
2.5.1. Durability
2.6. Partitioning Support
3. Programming Model
3.1. Declaring and Binding Producers and Consumers
3.1.1. Triggering Binding Via @EnableBinding
3.1.2. @Input and @Output
Customizing Channel Names
Source, Sink, and Processor
3.1.3. Accessing Bound Channels
Injecting the Bound Interfaces
Injecting Channels Directly
3.1.4. Producing and Consuming Messages
Native Spring Integration Support
Spring Integration Error Channel Support
Message Channel Binders and Error Channels
Using @StreamListener for Automatic Content Type Handling
Using @StreamListener for dispatching messages to multiple methods
Using Polled Consumers
3.1.5. Reactive Programming Support
Reactor-based handlers
Reactive Sources
3.1.6. Aggregation
Configuring aggregate application
Configuring binding service properties for non self contained aggregate application
4. Binders
4.1. Producers and Consumers
4.2. Binder SPI
4.3. Binder Detection
4.3.1. Classpath Detection
4.4. Multiple Binders on the Classpath
4.5. Connecting to Multiple Systems
4.6. Binder configuration properties
5. Configuration Options
5.1. Spring Cloud Stream Properties
5.2. Binding Properties
5.2.1. Properties for Use of Spring Cloud Stream
5.2.2. Consumer properties
5.2.3. Producer Properties
5.3. Using dynamically bound destinations
6. Content Type and Transformation
6.1. MIME types
6.2. Channel contentType and Message Headers
6.3. ContentType handling for output channels
6.4. ContentType handling for input channels
6.5. Customizing message conversion
6.6. @StreamListener and Message Conversion
7. Schema evolution support
7.1. Apache Avro Message Converters
7.2. Converters with schema support
7.3. Schema Registry Support
7.4. Schema Registry Server
7.4.1. Schema Registry Server API
POST /
GET /{subject}/{format}/{version}
GET /{subject}/{format}
GET /schemas/{id}
DELETE /{subject}/{format}/{version}
DELETE /schemas/{id}
DELETE /{subject}
7.5. Schema Registry Client
7.5.1. Using Confluent’s Schema Registry
7.5.2. Schema Registry Client properties
7.6. Avro Schema Registry Client Message Converters
7.6.1. Avro Schema Registry Message Converter properties
7.7. Schema Registration and Resolution
7.7.1. Schema Registration Process (Serialization)
7.7.2. Schema Resolution Process (Deserialization)
8. Inter-Application Communication
8.1. Connecting Multiple Application Instances
8.2. Instance Index and Instance Count
8.3. Partitioning
8.3.1. Configuring Output Bindings for Partitioning
Configuring Input Bindings for Partitioning
9. Testing
9.1. Disabling the test binder autoconfiguration
10. Health Indicator
11. Metrics Emitter
12. Samples
13. Getting Started
13.1. Deploying Stream applications on CloudFoundry
II. Binder Implementations
14. Apache Kafka Binder
14.1. Usage
14.2. Apache Kafka Binder Overview
14.3. Configuration Options
14.3.1. Kafka Binder Properties
14.3.2. Kafka Consumer Properties
14.3.3. Kafka Producer Properties
14.3.4. Usage examples
Example: Setting autoCommitOffset false and relying on manual acking.
Example: security configuration
Example: Pausing and Resuming the Consumer
Using the binder with Apache Kafka 0.10
Excluding Kafka broker jar from the classpath of the binder based application
14.4. Error Channels
14.5. Kafka Metrics
14.6. Dead-Letter Topic Processing
14.7. Partitioning with the Kafka Binder
14.8. Kafka Streams Binding Capabilities of Spring Cloud Stream
14.8.1. Usage example of high level streams DSL
14.8.2. Multiple Input bindings on the inbound
14.8.3. Support for branching in Kafka Streams API
14.8.4. Message conversion in Spring Cloud Stream Kafka Streams applications
Outbound serialization
Inbound Deserialization
Error handling on Deserialization exceptions
Handling Non-Deserialization exceptions
14.8.5. Support for interactive queries
14.8.6. Kafka Streams properties
15. RabbitMQ Binder
15.1. Usage
15.2. RabbitMQ Binder Overview
15.3. Configuration Options
15.3.1. RabbitMQ Binder Properties
15.3.2. RabbitMQ Consumer Properties
15.3.3. Rabbit Producer Properties
15.4. Retry With the RabbitMQ Binder
15.4.1. Overview
15.4.2. Putting it All Together
15.5. Error Channels
15.6. Dead-Letter Queue Processing
15.6.1. Non-Partitioned Destinations
15.6.2. Partitioned Destinations
republishToDlq=false
republishToDlq=true
15.7. Partitioning with the RabbitMQ Binder
III. Appendices
A. Building
A.1. Basic Compile and Test
A.2. Documentation
A.3. Working with the code
A.3.1. Importing into eclipse with m2eclipse
A.3.2. Importing into eclipse without m2eclipse
A.4. Sign the Contributor License Agreement
A.5. Code Conventions and Housekeeping