[rabbitmq-discuss] Using RabbitMQ as Messaging Exchange

Ben Hood 0x6e6562 at gmail.com
Sun Aug 24 17:42:10 BST 2008


On Sun, Aug 24, 2008 at 3:35 PM, Pete Kay <petedao at gmail.com> wrote:
> What I am planning to do is to have C clients publishing some events ( as
> text message ) to RabbitMQ and on the other side, I would have Jave clients
> that need to listen on the messages.
> The tricky part is that I need something in between Java clients and
> RabbitMQ to do the brokering based on an ID.  For example, the C clients
> will associate each event with an ID.  Each Java client may listen to events
> of one or more IDs.  I am not sure if I can program that brokering rule
> within RabbitMQ or I need a singleton client to listen on all messages
> coming out of RabbitMQ and then do the brokering to the end-clients.

This could be handled quite simply with plain jane AMQP, for example
using a direct exchange.

Without wanting to be boring, the spec explains how you would do this
quite well:

The direct exchange type works as follows:

 1. A message queue binds to the exchange using a routing key, K.
 2. A publisher sends the exchange a message with the routing key R.
 3. The message is passed to the message queue if K = R

So you don't need to do this yourself, because this is the type of
thing that the broker will do for you.

BTW, we don't have a C client ATM that you can use out of the box :-(

This is, amongst many other things, on our todo list, but being an
open source outfit, we don't have unlimited resources.

So for anybody interested in a C client, I can only re-iterate how
easy (and rewarding, because you would get a Rabbit T-Shirt) it would
be to write an AMQP client in C  -  see this guide about how to do it
: http://hopper.squarespace.com/blog/2008/6/21/build-your-own-amqp-client.html

We do of course, have a Java client that we maintain.



More information about the rabbitmq-discuss mailing list