noodlefrenzy / node-amqp10

amqp10 is a promise-based, AMQP 1.0 compliant node.js client
MIT License
134 stars 56 forks source link

Only one receiver is receiving a message at a time. #350

Closed pulasthibandara closed 11 months ago

pulasthibandara commented 6 years ago

Hi, I have a very beginner question where I have set up ActiveMq and a single sender sending messages to a queue "test". I have set up two receivers, and subscribe to queue "test".

My issue is that at a time, only a single receiver is receiving a message. ie: when receiver 1 gets the message receiver 2 does not. I want both receivers to get the same message.

I'm pretty sure I haven't configured the connection properly. How do I implement this scenario.

Thanks.

pulasthibandara commented 6 years ago

I managed to narrow this down to setting the distributionMode of the Link to copy. But I cant figure out a way to set it on a client or a receiver.

ps2goat commented 6 years ago

This is the point of a queue-- only one process gets a message so there is no duplication. You'll have to configure the message's duplication on the server, e.g., by mirroring queues, publishing the messages to multiple queues, etc. With ActiveMQ, here are some options: http://activemq.apache.org/virtual-destinations.html