Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduled messages with RabbitMQ

I'm looking for a solution to have scheduled messages with RabbitMQ, so not only delaying the messages as described in several sources but schedule it to have a message e.g. every day.

If not RabbitMQ, any other solutions out there you can think of and you'd suggest for a microservices environment using a message-bus? So it's really about combining the concept of a task-scheduler and a message bus ...

Or is it better to use a job scheduler just to push messages to the message queue, e.g. using rundeck in combination with RabbitMQ?

like image 910
Stefan Walther Avatar asked Nov 25 '16 14:11

Stefan Walther


People also ask

Does RabbitMQ support message ordering?

Message ordering guarantees Messages can be returned to the queue using AMQP methods that feature a requeue parameter (basic. recover, basic. reject and basic. nack), or due to a channel closing while holding unacknowledged messages.

What is delayed exchange in RabbitMQ?

The RabbitMQ delayed exchange plugin is used to implement a wait time between when a message reaches the exchange and when it is delivered to a queue. Every time a message is published, an offset in milliseconds can be specified.

Can RabbitMQ push messages?

Applications can subscribe to have RabbitMQ push enqueued messages (deliveries) to them. This is done by registering a consumer (subscription) on a queue. After a subscription is in place, RabbitMQ will begin delivering messages. For each delivery a user-provided handler will be invoked.

Does RabbitMQ automatically create queues?

In RabbitMQ, a producer never sends a message directly to a queue. Instead, it uses an exchange as a routing mediator. Therefore, the exchange decides if the message goes to one queue, to multiple queues, or is simply discarded.


1 Answers

Or is it better to use a job scheduler just to push messages to the message queue, e.g. using rundeck in combination with RabbitMQ?

yes.

RabbitMQ is not designed to handle scheduling, and attempting to use it for that will just be painful (at best).

It is best to use another scheduling system, like cron jobs or rundeck or any of the other numerous scheduling tools available. From that tool, you can execute code that will push messages across RabbitMQ, triggering work in other parts of your system.

like image 119
Derick Bailey Avatar answered Sep 17 '22 14:09

Derick Bailey