You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by dmounessa <dm...@yahoo.com> on 2011/11/13 22:42:11 UTC

Broker sends messages to all Topics

I have just started using the QPID C++ Broker with JAVA JMS API. When I run
the Hello.java included in the package, it sends one message and receives a
messages back.
When I run this on multiple topics, all subscribers receives messages from
all message producers. I enabled log on the Broker and it seems one message
is broadcast to all subscribers. What do I need to change the Hello.java app
so not to do this or is this the C++ Broker configuration.


Thanks for your help.

--
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/Broker-sends-messages-to-all-Topics-tp6990841p6990841.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Broker sends messages to all Topics

Posted by Gordon Sim <gs...@redhat.com>.
On 11/13/2011 09:42 PM, dmounessa wrote:
> I have just started using the QPID C++ Broker with JAVA JMS API. When I run
> the Hello.java included in the package, it sends one message and receives a
> messages back.
> When I run this on multiple topics, all subscribers receives messages from
> all message producers. I enabled log on the Broker and it seems one message
> is broadcast to all subscribers. What do I need to change the Hello.java app
> so not to do this or is this the C++ Broker configuration.

Not quite sure what you mean by running this example 'on multiple 
topics', but the Hello.java example uses a Topic destination i.e. one 
backed by an AMQP exchange.

If you want each message to go to only one consumer, you want to use a 
Queue destination.

A simple way to do that is just to change the name in the 
hello.properties from amq.topic to the name of your queue (assuming the 
queue has already been created).

If you want the queue created on demand (not something I would recommend 
in general) you can use an address of the form:

   my-queue; {create: always}

rather than a simple name (replace my-queue with the name of the queue 
you wish to create/use).

Hope this helps.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org