Copy messages from queue to another queue in the same node

793 views
Skip to first unread message

Boopathy Ravi

unread,
Dec 13, 2022, 3:47:25 PM12/13/22
to rabbitmq-users
Hello,

I have a two queues Test 1 and Test 2 in the same node. when a new message arrives.  I want to copy the messages from test 1 to Test 2. Could you please let me know how it can be done. Note that Test 1 and Test 2 have their respective consumers.

Thanks,
Boopathy.

Michal Kuratczyk

unread,
Dec 13, 2022, 4:55:47 PM12/13/22
to rabbitm...@googlegroups.com
Hi,

That's what exchanges are for - you can configure them that messages that match the criteria to be delivered to test1, will also be delivered to test2.
You can achieve this by declaring multiple bindings with the same routing key (one per queue) or by using a fanout exchange.

Best,

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/910c5104-863f-45cb-b3f7-139e2830d3fan%40googlegroups.com.


--
Michał
RabbitMQ team

Korrapati Srilatha

unread,
Dec 15, 2022, 4:42:42 AM12/15/22
to rabbitm...@googlegroups.com
Hi Ravi,

First you can bind the two queues
with same binding key to an exchange. And then publish the 
message to exchange using same routing key. Here the exchange type should be direct.

--
Reply all
Reply to author
Forward
0 new messages