madhairsilence
madhairsilence

Reputation: 3870

Single consumer for multiple queues in the Same JMS Server

I have a ActiveMQ AMQP Server running and I have a single consumer listening to the queue

Now i have three different producers

Producers 1 produces to Queue 1 Producers 2 produces to Queue 2 Producers 3 produces to Queue 3

All the three queues are from same server.

The question is

Can I make the Single consumer to listen to all these three queue??

If yes how to make it in Spring

Currently, my consumer is successfully by the following connection configuration

<bean id="blazeDestination" class="org.apache.qpid.amqp_1_0.jms.impl.QueueImpl">
        <constructor-arg index="0" value="ctest2" />        
 </bean>

My Consumer is listening to the queue name ctest2

Can I make something lie

<bean id="blazeDestination" class="org.apache.qpid.amqp_1_0.jms.impl.QueueImpl">
        <constructor-arg index="0" value="ctest2" />        
        <constructor-arg index="0" value="ctest3" />        
        <constructor-arg index="0" value="ctest4" />        
    </bean>

So that it listens to all the three queues!

Upvotes: 0

Views: 2432

Answers (2)

madhairsilence
madhairsilence

Reputation: 3870

Just answering my own question. During the time , I type this, it is not possible. We cannot make a consumer to listen to more than once queue.

Upvotes: 0

Petter Nordlander
Petter Nordlander

Reputation: 22279

You could do something like that if you did not use the QPid client, but the ActiveMQ client.

Still, you can also do some composite queue magic server side in XML configuration if you really need something like that. Just setup several composite queues with forward to a single physical queue that you read. It's not really the same thing, but it might (or might not?) solve your case.

Upvotes: 1

Related Questions