title: Stomp Broadcast with Rabbitmq and Python
body: <p>Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every listener.</p>
  
  <p>Can anyone tell me how to achieve the same kind of message distribution?</p>
  
  <p>The stomp library used below is <a href="http://code.google.com/p/stomppy/" rel="nofollow noreferrer">http://code.google.com/p/stomppy/</a></p>
  
  <p>Failing being able to do with with stomp, even a amqplib example would really help.</p>
  
  <p>My code at present looks like this</p>
  
  <p>The Consumer</p>
  
  <pre><code>import stomp
  
  class MyListener(object):
      def on_error(self, headers, message):
          print 'recieved an error %s' % message
  
      def on_message(self, headers, message):
          print 'recieved a message %s' % message
  
  conn = stomp.Connection([('0.0.0.0', 61613), ('127.0.0.1', 61613)], 'user', 'password')
  conn.set_listener('', MyListener())
  conn.start()
  conn.connect(username="user", password="password")
  headers = {}
  
  conn.subscribe(destination='/topic/demoqueue', ack='auto')
  
  while True:
      pass
  conn.disconnect()
  </code></pre>
  
  <p>And the sender looks like this</p>
  
  <pre><code>import stomp
  
  class MyListener(object):
      def on_error(self, headers, message):
          print 'recieved an error %s' % message
  
      def on_message(self, headers, message):
          print 'recieved a message %s' % message
  
  conn = stomp.Connection([('0.0.0.0', 61613), ('127.0.0.1', 61613)], 'user', 'password')
  conn.set_listener('', MyListener())
  conn.start()
  conn.connect(username="user", password="password")
  headers = {}
  
  conn.subscribe(destination='/topic/demotopic', ack='auto')
  
  while True:
      pass
  conn.disconnect()
  </code></pre>