nuwber/rabbitevents

Give ability to explicitly set queue name in `rabbitevents:listen` command

Closed this issue · 2 comments

asv commented

Currently, when calling the rabbitevents:listen command, you can specify the name of the service and a list of events to listen to. Based on this information, the name of the queue in RabbitMQ is formed. This approach has a problem, which is that the queue name is not stable when the list of events changes (adding, removing new routing keys).

This leads to the following unpleasant side effects:

  1. After deploying new topology we have 2 queues (old and new) in RMQ. The old one can only be deleted manually.
  2. In multi-instance deployment, a situation may arise when the same event is processed from the new queue (in new instances) and the old queue (instances have not been updated yet). In case the processing lacks indepotency (unfortunately, it happens) we can get duplication. We may also face a situation when there are messages in old queue that we have not had time to process, but they are not in new queue.

My suggestion is to allow you to explicitly set queue name in the rabbitevents:listen command. This would solve at least the problems described above, as well as improve the readability (and documentation) of queues in the Management Console.

Hey @asv.
Thank you for your proposal. I'll take a look on it.

Feel free to make a PR