[rabbitmq-discuss] topic behavior instead of queue behavior with rabbitmq-stomp

Tony Garnock-Jones tonyg at lshift.net
Wed Feb 11 12:52:25 GMT 2009

mark wrote:
> how do i enable the topic behavior where all subscribers get all the
> messages in a channel using rabbitmq-stomp.
> by default it sends the message only to one subscriber like a queue.
> thanks a lot!

You will need to start using exchanges. Please see section 3.1.3 of the
AMQP 0-8 specification PDF
for information on the kinds of exchanges that are available.

To read from a fanout exchange using Ruby STOMP,

  conn = Stomp::Connection.open('guest', 'guest', 'localhost')
  conn.subscribe('', :exchange => 'myexchange')

To write to a fanout exchange using Ruby STOMP,

  conn.send 'routingkey', 'messagebody', :exchange => 'myexchange'

STOMP provides no facility (yet) for declaring exchanges. You will need
to use an AMQP client library (e.g. the Java one) to declare the
exchanges your application will need.


More information about the rabbitmq-discuss mailing list