Spring Cloud Stream Tutorial (ii) Key concepts

Source: Internet
Author: User
Tags rabbitmq

Spring Cloud Stream provides some abstractions and primitives that simplify the writing of message-driven microservices applications. This section outlines the following:

Application model of Spring Cloud stream

Binder Abstraction

Continuous publish-Subscribe support

Consumer group Support

Partition support

One pluggable binder API

Application Model

A spring Cloud stream application consists of a middleware-neutral core. The application communicates with the outside world through the input and output channels that the spring Cloud stream injects into. Channels are connected to external brokers through middleware-specific binder implementations.

SCST and Adhesives
Figure 5. Spring Cloud Stream App
Fat jar

The Spring Cloud stream application can be run from the IDE in standalone mode for testing. To run the spring Cloud stream application in production, you can use the standard Spring Boot tool provided for MAVEN or Gradle to create an executable (or "fat") JAR.

Binder Abstraction

Spring Cloud Stream provides binder implementations for Kafka and Rabbit MQ. Spring Cloud Stream also includes a testsupportbinder, which retains an unmodified channel so that the test can interact directly and reliably with the channel. You can use the Extensible API to write your own binder.

Spring Cloud Stream is configured with spring boot, and the binder abstraction allows the spring cloud stream application to have the flexibility to connect to the middleware. For example, a deployer can dynamically select the destination of a channel connection at run time (for example, Kafka topic or RABBITMQ Interchange). Such configurations can be provided in any form supported by external configuration properties and spring Boot (including application parameters, environment variables, and application.yml or application.properties files). In the receiver example that introduces the spring Cloud stream section, Setting the application properties spring.cloud.stream.bindings.input.destination to Raw-sensor-data will make it from Raw-sensor-data Kafka the theme or swap from binding to Raw-sensor-data RABBITMQ.

Spring Cloud stream automatically detects and uses the binder found in the classpath. You can use the same code to easily work with different types of middleware: only the different binders are included in the build. For more complex use cases, you can also package multiple binders in your application, choose a binder at run time, or even use a different binder for different channels.

Spring Cloud Stream Tutorial (ii) Key concepts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.