You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by nbdxkfq <be...@gmail.com> on 2014/04/06 05:33:07 UTC

How can a consumer subscribe multiple queue and multiple topic at the same time

Hi All,

I am working on a project requiring to use ActiveMQ. In this project, a
consumer should listen to multiple queue and multiple topics at the same
time. When I set destination, I put "queue://demo.queue1,
queue://demo.queue2, queue://demo.queue3, topic://demo.topic1,
topic://demo.topic2, topic://demo.topic3" for both producer and consumer.
However, consumer can only receive messages in queue1, queue2 and queue3.
Although I can see the message in topic1, topic2 and topic3 in ActiveMQ
website, but the consumer cannot receive it. If the destination is set as
"topic://demo.topic1, topic://demo.topic2, topic://demo.topic3,
queue://demo.queue1, queue://demo.queue2, queue://demo.queue3", then only
the message in topics can be received.

May I ask if there is any solutions for this situation?

Thank you

Ben



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-a-consumer-subscribe-multiple-queue-and-multiple-topic-at-the-same-time-tp4680095.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can a consumer subscribe multiple queue and multiple topic at the same time

Posted by artnaseef <ar...@artnaseef.com>.
There are ways to get what you want. Composite destinations arr nice, but I personally avoid them as they require a lot of special-case handling which I am not convinced is 100%. 

Sent from my iPhone

> On Apr 5, 2014, at 8:33 PM, "nbdxkfq [via ActiveMQ]" <ml...@n4.nabble.com> wrote:
> 
> Hi All, 
> 
> I am working on a project requiring to use ActiveMQ. In this project, a consumer should listen to multiple queue and multiple topics at the same time. When I set destination, I put "queue://demo.queue1, queue://demo.queue2, queue://demo.queue3, topic://demo.topic1, topic://demo.topic2, topic://demo.topic3" for both producer and consumer. However, consumer can only receive messages in queue1, queue2 and queue3. Although I can see the message in topic1, topic2 and topic3 in ActiveMQ website, but the consumer cannot receive it. If the destination is set as "topic://demo.topic1, topic://demo.topic2, topic://demo.topic3, queue://demo.queue1, queue://demo.queue2, queue://demo.queue3", then only the message in topics can be received. 
> 
> May I ask if there is any solutions for this situation? 
> 
> Thank you 
> 
> Ben 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/How-can-a-consumer-subscribe-multiple-queue-and-multiple-topic-at-the-same-time-tp4680095.html
> To start a new topic under ActiveMQ - User, email ml-node+s2283324n2341805h3@n4.nabble.com 
> To unsubscribe from ActiveMQ - User, click here.
> NAML




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-a-consumer-subscribe-multiple-queue-and-multiple-topic-at-the-same-time-tp4680095p4680101.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can a consumer subscribe multiple queue and multiple topic at the same time

Posted by Gary Tully <ga...@gmail.com>.
composite dests across destination types only work for message
prodiucers, you need a consumer per destination type.
peel at the unit test that validates this, note the use of consumer2

https://github.com/apache/activemq/blob/20f384ce59b758a0f3c1b0e0620e2efd58ca230a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java

On 6 April 2014 04:33, nbdxkfq <be...@gmail.com> wrote:
> Hi All,
>
> I am working on a project requiring to use ActiveMQ. In this project, a
> consumer should listen to multiple queue and multiple topics at the same
> time. When I set destination, I put "queue://demo.queue1,
> queue://demo.queue2, queue://demo.queue3, topic://demo.topic1,
> topic://demo.topic2, topic://demo.topic3" for both producer and consumer.
> However, consumer can only receive messages in queue1, queue2 and queue3.
> Although I can see the message in topic1, topic2 and topic3 in ActiveMQ
> website, but the consumer cannot receive it. If the destination is set as
> "topic://demo.topic1, topic://demo.topic2, topic://demo.topic3,
> queue://demo.queue1, queue://demo.queue2, queue://demo.queue3", then only
> the message in topics can be received.
>
> May I ask if there is any solutions for this situation?
>
> Thank you
>
> Ben
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-can-a-consumer-subscribe-multiple-queue-and-multiple-topic-at-the-same-time-tp4680095.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com