开发者

ActiveMQ single consumer multiple producers

开发者 https://www.devze.com 2023-01-05 19:36 出处:网络
Can anybody point out a reference on how to implement开发者_如何学C a single consumer multiple producer in activemq? Or could give a very simple implementation.

Can anybody point out a reference on how to implement开发者_如何学C a single consumer multiple producer in activemq? Or could give a very simple implementation. This will be very helpful.

Thanks


Matt Raible's AppFuse project is a good skeleton project which is implemented using different libraries. You can pick the one which uses Spring and introduce ActiveMQ as Bharati Raja has explained in his blog post jms with appfuse1x.


There is no special implementation required for this. This is the core business of MessageBrokers. The only thing you need to make sure of:

If you decide to give an ID to your producers, make sure they are different from each other.. You cannot have multiple producers with the same ID. Same goes for consumers.


If you need to guarantee that a message can be consumed by only one consumer, then this is the point-to-point communication model which can be implemented using a JMS Queue in ActiveMQ.

Many producers can send messages to the same queue. Only one active consumer will receive a message from the queue.

0

精彩评论

暂无评论...
验证码 换一张
取 消