[rabbitmq-discuss] Clarification needed on how to publish to topic exchange

Matthew Sackman matthew at lshift.net
Fri Oct 9 13:13:43 BST 2009


Hi George,

On Fri, Oct 09, 2009 at 11:10:00PM +1100, George Haidar wrote:
> I have rabbitmq-server installed  - checked out from mercurial and
> built along with all plugins at the time of writing. I created two
> mock java application to test it out - one to publish, one to
> subscribe. My program is based on the example listed on the rabbitmq
> site under the java api guide. I setup a topic exchange ("report") and
> a queue ("live") and bound the two together with the binding key
> "report.live". Then I tried to publish message using the routing key
> "report.*". `rabbitmqctl list_queue -p bfms` reports 0 messages in the
> "live" queue. I was wondering if what I am trying to do is even
> possible. If it is, what am I doing wrong?

You have routing key and binding key confused. The binding key is the
one that can have wildcards ('*' and '#') in it. The routing key does
not. So you should use a binding key of "report.*" and set the routing
key, when publishing, to "report.live".

Hope that helps,

Matthew




More information about the rabbitmq-discuss mailing list