Declaring and binding channels

Thanks to the use of Spring Integration, the application is independent from a message broker implementation included in the project. Spring Cloud Stream automatically detects and uses a binder found on the classpath. It means we may choose different types of middleware, and use it with the same code. All the middleware-specific settings can be overridden through external configuration properties in the form supported by Spring Boot, such as application arguments, environment variables, or just the application.yml file. As I have mentioned before, Spring Cloud Stream provides binder implementations for Kafka and Rabbit MQ. To include support for Kafka, you add the following dependency to the project:

<dependency> ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.