RabbitMQ delay queue pitfalls

1. Use RabbitMQ's delay queue to implement delayed sending of messages. I wrote a demo and it works fine.

https://www.cnblogs.com/mfrank/p/11260355.html

 

2. During actual use, it was found that some messages were not consumed according to the specified delay time.

https://www.zhihu.com/question/65916221

 

Only after google did I know that the delay queue has several characteristics: 1. First in, first out; 2. When the front message is not consumed, the subsequent messages will not be consumed even if they reach the delay time;

Therefore, messages with different delay times cannot be put into the same queue. In other words, different queues must be created for different delay times.

However, in actual business, there will definitely be a large number of messages with different delay times. It is definitely unrealistic to create many different queues for this purpose. There must be other, more reasonable ways to achieve this.

 

3. Use rabbitmq-delayed-message-exchange plug-in to implement.

For specific configuration and implementation methods, please refer to the following blog post

https://blog.csdn.net/u014308482/article/details/53036770

 

 

Guess you like

Origin blog.csdn.net/u011453631/article/details/107458966