First acquaintance with spring cloud stream

What is spring cloud stream? What can I do? Why should he be introduced?

 Spring cloud stream Chinese instruction manual address: m.wang1314.com/doc/webapp/topic/20971999.html

 Spring cloud stream uses Binder as the binding layer to achieve isolation: 

 

 

  Common notes on spring cloud stream:

So far, start to write a small Demo, take RabbitMQ as an example:

 

Producer 8801: 

 

 

 

 The following consumer 8802: Same as the 8803 code

 

 After 8802 and 8803 are started, there are two problems: 1.8802 and 8803 have received messages at the same time, there is a problem of repeated consumption 2. Message persistence problem;

 

 

 Two consumers, 8802 and 8803 in the same group are ok. After the producer sends a message, each microservice under the same group reads the message through polling.

 After talking about repeated consumption, let's talk about persistence: as long as the 8803 is configured with groupA, when it is turned on again, it will receive the message sent by the producer before, which is persistence.

Guess you like

Origin blog.csdn.net/zhangleiyes123/article/details/106943193