Spring Cloud Stream Reference Guide


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, Gary Russell, Oleg Zhurakousky, Jay Bryant

Table of Contents

I. Spring Cloud Stream Core
1. Quick Start
1.1. Creating a Sample Application by Using Spring Initializr
1.2. Importing the Project into Your IDE
1.3. Adding a Message Handler, Building, and Running
2. What’s New in 2.0?
2.1. New Features and Components
2.2. Notable Enhancements
2.2.1. Both Actuator and Web Dependencies Are Now Optional
2.2.2. Content-type Negotiation Improvements
2.3. Notable Deprecations
2.3.1. Java Serialization (Java Native and Kryo)
2.3.2. Deprecated Classes and Methods
3. Introducing Spring Cloud Stream
4. Main Concepts
4.1. Application Model
4.1.1. Fat JAR
4.2. The Binder Abstraction
4.3. Persistent Publish-Subscribe Support
4.4. Consumer Groups
4.5. Consumer Types
4.5.1. Durability
4.6. Partitioning Support
5. Programming Model
5.1. Destination Binders
5.2. Destination Bindings
5.3. Producing and Consuming Messages
5.3.1. Spring Integration Support
5.3.2. Using @StreamListener Annotation
5.3.3. Using @StreamListener for Content-based routing
5.3.4. Using Polled Consumers
5.4. Error Handling
5.4.1. Application Error Handling
5.4.2. System Error Handling
Drop Failed Messages
DLQ - Dead Letter Queue
Re-queue Failed Messages
5.4.3. Retry Template
5.5. Reactive Programming Support
5.5.1. Reactor-based Handlers
5.5.2. Reactive Sources
6. Binders
6.1. Producers and Consumers
6.2. Binder SPI
6.3. Binder Detection
6.3.1. Classpath Detection
6.4. Multiple Binders on the Classpath
6.5. Connecting to Multiple Systems
6.6. Binding visualization and control
6.7. Binder Configuration Properties
7. Configuration Options
7.1. Binding Service Properties
7.2. Binding Properties
7.2.1. Common Binding Properties
7.2.2. Consumer Properties
7.2.3. Producer Properties
7.3. Using Dynamically Bound Destinations
8. Content Type Negotiation
8.1. Mechanics
8.1.1. Content Type versus Argument Type
8.1.2. Message Converters
8.2. Provided MessageConverters
8.3. User-defined Message Converters
9. Schema Evolution Support
9.1. Schema Registry Client
9.1.1. Schema Registry Client Properties
9.2. Avro Schema Registry Client Message Converters
9.2.1. Avro Schema Registry Message Converter Properties
9.3. Apache Avro Message Converters
9.4. Converters with Schema Support
9.5. Schema Registry Server
9.5.1. Schema Registry Server API
Registering a New Schema
Retrieving an Existing Schema by Subject, Format, and Version
Retrieving an Existing Schema by Subject and Format
Retrieving an Existing Schema by ID
Deleting a Schema by Subject, Format, and Version
Deleting a Schema by ID
Deleting a Schema by Subject
9.5.2. Using Confluent’s Schema Registry
9.6. Schema Registration and Resolution
9.6.1. Schema Registration Process (Serialization)
9.6.2. Schema Resolution Process (Deserialization)
10. Inter-Application Communication
10.1. Connecting Multiple Application Instances
10.2. Instance Index and Instance Count
10.3. Partitioning
10.3.1. Configuring Output Bindings for Partitioning
10.3.2. Configuring Input Bindings for Partitioning
11. Testing
11.1. Disabling the Test Binder Autoconfiguration
12. Health Indicator
13. Metrics Emitter
14. Samples
14.1. Deploying Stream Applications on CloudFoundry
II. Binder Implementations
15. Apache Kafka Binder
15.1. Usage
15.2. Apache Kafka Binder Overview
15.3. Configuration Options
15.3.1. Kafka Binder Properties
15.3.2. Kafka Consumer Properties
15.3.3. Kafka Producer Properties
15.3.4. Usage examples
Example: Setting autoCommitOffset to false and Relying on Manual Acking
Example: Security Configuration
Example: Pausing and Resuming the Consumer
15.4. Error Channels
15.5. Kafka Metrics
15.6. Dead-Letter Topic Processing
15.7. Partitioning with the Kafka Binder
16. Apache Kafka Streams Binder
16.1. Usage
16.2. Kafka Streams Binder Overview
16.2.1. Streams DSL
16.3. Configuration Options
16.3.1. Kafka Streams Properties
16.3.2. TimeWindow properties:
16.4. Multiple Input Bindings
16.4.1. Multiple Input Bindings as a Sink
16.4.2. Multiple Input Bindings as a Processor
16.5. Multiple Output Bindings (aka Branching)
16.6. Message Conversion
16.6.1. Outbound serialization
16.6.2. Inbound Deserialization
16.7. Error Handling
16.7.1. Handling Deserialization Exceptions
16.7.2. Handling Non-Deserialization Exceptions
16.8. Interactive Queries
16.9. Accessing the underlying KafkaStreams object
17. RabbitMQ Binder
17.1. Usage
17.2. RabbitMQ Binder Overview
17.3. Configuration Options
17.3.1. RabbitMQ Binder Properties
17.3.2. RabbitMQ Consumer Properties
17.3.3. Rabbit Producer Properties
17.4. Retry With the RabbitMQ Binder
17.4.1. Putting it All Together
17.5. Error Channels
17.6. Dead-Letter Queue Processing
17.6.1. Non-Partitioned Destinations
17.6.2. Partitioned Destinations
17.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