Cách tạo delay exchange
https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq
Step 1:
Installing the Plugin
To install the plugin go to our Community Plugins page and download the corresponding .ez files for your RabbitMQ installation. Copy the plugin into RabbitMQ's plugin folder and then enable it by running the following command:
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
Step 2: Tạo exchange
Type : x-delayed-message
args: ("x-delayed-type", "direct");
Step 3: Send Message
headers.put("x-delay", 5000); <=> 5000 ms or 5 seconds
Comments
Post a Comment