views:

39

answers:

3

hi guys,

can anybody point out a reference on how to implement a single consumer multiple producer in activemq Or could give a very simple implementation this will be very helpful.

tnx

A: 

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.

Boris Pavlović
is this an implementation of a single consumer multiple producer?
jaded
Initialize as many producers as you need and just one consumer
Boris Pavlović
A: 

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.

Noctris
A: 

If you need to guarantee that a message can be consumed by only one consumer, then this is the peer-to-peer/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.

mjustin