Reflections on the message queue of message loss problems - Message Queue

Reflections on the message queue of message loss problems - Message Queue

  

  The use of messaging middleware must face two major problems - message loss or duplication of messages.

   Message loss solution mainly through the message retransmission compensation means, after the news retransmission causes the message to repeat, repeat the message and so need to use the power of resolve.

 

   

 

 

  Message from production to consumption, generally requires three phases by FIG. Mature messaging middleware designers will consider this issue. rabbitmq at the production stage, generally there will be a callback confirmation mechanism, the storage phase, there will be persistent allocation strategy, consumption stage mechanism will confirm the success of the consumer. In the spring when the package rabbitmq, the default allocation strategy is very user-friendly, the stage storage configured to default persistent, abnormal consumption stage there is no default and then confirm the success of the consumer to mq.

  The question is whether in the production of man-made messages to ensure one hundred percent sure that the message success? Because im using a callback mechanism, retry strategy, or lost messages in extreme cases.

  If you want to ensure one hundred percent successful, the database needs to be introduced, more complex design, ( refer to learning materials )

  

 

 

   If every time you use messaging middleware, are guaranteed one hundred percent successful, the entire system will become increasingly complex.

  Therefore, the important core business, such as money-related business, we must ensure one hundred percent,

  On the non-core business, you can use a simple strategy retry retry several times, sending data to prevent loss due to network news.

  The point is that we must first ensure that business data (such as order data) storage successfully , go to send a message to mq for other consumer spending.

  Such instant lost to mq when sending messages, and also can check the library after the replacement .

  If there are errors, welcome treatise.

 

Guess you like

Origin www.cnblogs.com/timfruit/p/12634579.html