Is it possible to move / merge messages between RabbitMQ queues?

I want to know if it is possible to move / merge messages from one queue to another. For instance:

main-queue contains messages ['cat-1','cat-2','cat-3','cat-4','dog-1','dog-2','cat-5']

dog-queue contains messages ['dog-1, dog-2, dog-3, dog-4]

So, the question is (if both queues are in the same cluster, vhost), can I move messages from dog-queueto main-queueusing rabbitmqctl?

So in the end I want to get something like:

Perfectly:

main-queue: ['cat-1','cat-2','cat-3','cat-4','dog-1','dog-2','cat-5', dog-3, dog-4]

But this is also normal:

main-queue: ['cat-1','cat-2','cat-3','cat-4','dog-1','dog-2','cat-5', 'dog-1, dog-2, dog-3, dog-4]

+3
source share
1 answer

, , - 'shovel'. , . , ( / ).

cli:

sudo rabbitmq-plugins enable rabbitmq_shovel

RabbitMQ , mgmt :

sudo rabbitmq-plugins enable rabbitmq_shovel_management

GUI, " " "". , . , , , .


RabbitMQ CLI, rabbitmqctl:

sudo rabbitmqctl set_parameter shovel cats-and-dogs \
'{"src-uri": "amqp://user:pass@host/vhost", "src-queue": "dog-queue", \
"dest-uri": "amqp://user:pass@host/vhost", "dest-queue": "main-queue"}'

:

- https://www.rabbitmq.com/shovel.html
- https://www.rabbitmq.com/shovel-dynamic.html

+11

Source: https://habr.com/ru/post/1533409/


All Articles