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

Table of Contents

I. Spring Cloud Stream Core
1. A Brief History of Spring’s Data Integration Journey
2. Quick Start
2.1. Creating a Sample Application by Using Spring Initializr
2.2. Importing the Project into Your IDE
2.3. Adding a Message Handler, Building, and Running
3. What’s New in 2.0?
3.1. New Features and Components
3.2. Notable Enhancements
3.2.1. Both Actuator and Web Dependencies Are Now Optional
3.2.2. Content-type Negotiation Improvements
3.3. Notable Deprecations
3.3.1. Java Serialization (Java Native and Kryo)
3.3.2. Deprecated Classes and Methods
4. Introducing Spring Cloud Stream
5. Main Concepts
5.1. Application Model
5.1.1. Fat JAR
5.2. The Binder Abstraction
5.3. Persistent Publish-Subscribe Support
5.4. Consumer Groups
5.5. Consumer Types
5.5.1. Durability
5.6. Partitioning Support
6. Programming Model
6.1. Destination Binders
6.2. Destination Bindings
6.3. Producing and Consuming Messages
6.3.1. Spring Integration Support
6.3.2. Using @StreamListener Annotation
6.3.3. Using @StreamListener for Content-based routing
6.3.4. Spring Cloud Function support
Functional Composition
6.3.5. Using Polled Consumers
Overview
Handling Errors
6.4. Error Handling
6.4.1. Application Error Handling
6.4.2. System Error Handling
Drop Failed Messages
DLQ - Dead Letter Queue
Re-queue Failed Messages
6.4.3. Retry Template
6.5. Reactive Programming Support
6.5.1. Reactor-based Handlers
6.5.2. Reactive Sources
7. Binders
7.1. Producers and Consumers
7.2. Binder SPI
7.3. Binder Detection
7.3.1. Classpath Detection
7.4. Multiple Binders on the Classpath
7.5. Connecting to Multiple Systems
7.6. Binding visualization and control
7.7. Binder Configuration Properties
8. Configuration Options
8.1. Binding Service Properties
8.2. Binding Properties
8.2.1. Common Binding Properties
8.2.2. Consumer Properties
8.2.3. Producer Properties
8.3. Using Dynamically Bound Destinations
9. Content Type Negotiation
9.1. Mechanics
9.1.1. Content Type versus Argument Type
9.1.2. Message Converters
9.2. Provided MessageConverters
9.3. User-defined Message Converters
10. Schema Evolution Support
10.1. Schema Registry Client
10.1.1. Schema Registry Client Properties
10.2. Avro Schema Registry Client Message Converters
10.2.1. Avro Schema Registry Message Converter Properties
10.3. Apache Avro Message Converters
10.4. Converters with Schema Support
10.5. Schema Registry Server
10.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
10.5.2. Using Confluent’s Schema Registry
10.6. Schema Registration and Resolution
10.6.1. Schema Registration Process (Serialization)
10.6.2. Schema Resolution Process (Deserialization)
11. Inter-Application Communication
11.1. Connecting Multiple Application Instances
11.2. Instance Index and Instance Count
11.3. Partitioning
11.3.1. Configuring Output Bindings for Partitioning
11.3.2. Configuring Input Bindings for Partitioning
12. Testing
12.1. Disabling the Test Binder Autoconfiguration
13. Health Indicator
14. Metrics Emitter
15. Samples
15.1. Deploying Stream Applications on CloudFoundry
II. Binder Implementations
16. Apache Kafka Binder
16.1. Usage
16.2. Apache Kafka Binder Overview
16.3. Configuration Options
16.3.1. Kafka Binder Properties
16.3.2. Kafka Consumer Properties
16.3.3. Kafka Producer Properties
16.3.4. Usage examples
Example: Setting autoCommitOffset to false and Relying on Manual Acking
Example: Security Configuration
Example: Pausing and Resuming the Consumer
16.4. Error Channels
16.5. Kafka Metrics
16.6. Dead-Letter Topic Processing
16.7. Partitioning with the Kafka Binder
17. Apache Kafka Streams Binder
17.1. Usage
17.2. Kafka Streams Binder Overview
17.2.1. Streams DSL
17.3. Configuration Options
17.3.1. Kafka Streams Properties
17.3.2. TimeWindow properties:
17.4. Multiple Input Bindings
17.4.1. Multiple Input Bindings as a Sink
17.4.2. Multiple Input Bindings as a Processor
17.5. Multiple Output Bindings (aka Branching)
17.6. Message Conversion
17.6.1. Outbound serialization
17.6.2. Inbound Deserialization
17.7. Error Handling
17.7.1. Handling Deserialization Exceptions
17.7.2. Handling Non-Deserialization Exceptions
17.8. State Store
17.9. Interactive Queries
17.10. Accessing the underlying KafkaStreams object
17.11. State Cleanup
18. RabbitMQ Binder
18.1. Usage
18.2. RabbitMQ Binder Overview
18.3. Configuration Options
18.3.1. RabbitMQ Binder Properties
18.3.2. RabbitMQ Consumer Properties
18.3.3. Advanced Listener Container Configuration
18.3.4. Rabbit Producer Properties
18.4. Retry With the RabbitMQ Binder
18.4.1. Putting it All Together
18.5. Error Channels
18.6. Dead-Letter Queue Processing
18.6.1. Non-Partitioned Destinations
18.6.2. Partitioned Destinations
republishToDlq=false
republishToDlq=true
18.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