Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 239871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:37:13+00:00 2026-05-11T20:37:13+00:00

Im trying to move a system from using morbid to rabbitmq, but I cannot

  • 0

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.

Can anyone tell me how to achieve the same kind of message distribution?

The stomp library used below is http://code.google.com/p/stomppy/

Failing being able to do with with stomp, even a amqplib example would really help.

My code at present looks like this

The Consumer

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()

And the sender looks like this

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()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:37:13+00:00Added an answer on May 11, 2026 at 8:37 pm

    I finally figured out how to do it by creating an exchange for each “recieving group”, im not sure how well rabbit will do with thousands of exchanges, so you might want to figure test this heavily before trying it in production

    In the sending code:

    conn.send(str(i), exchange=exchange, destination='')
    

    The blank destination is required, all I care about is sending to that exchange

    To recieve

    import stomp
    import sys
    from amqplib import client_0_8 as amqp
    #read in the exchange name so I can set up multiple recievers for different exchanges to tset
    exchange = sys.argv[1]
    conn = amqp.Connection(host="localhost:5672", userid="username", password="password",
     virtual_host="/", insist=False)
    
    chan = conn.channel()
    
    chan.access_request('/', active=True, write=True, read=True)
    
    #declare my exchange
    chan.exchange_declare(exchange, 'topic')
    #not passing a queue name means I get a new unique one back
    qname,_,_ = chan.queue_declare()
    #bind the queue to the exchange
    chan.queue_bind(qname, exchange=exchange)
    
    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)], 'browser', 'browser')
    conn.set_listener('', MyListener())
    conn.start()
    conn.connect(username="username", password="password")
    headers = {}
    
    #subscribe to the queue
    conn.subscribe(destination=qname, ack='auto')
    
    while True:
        pass
    conn.disconnect()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Language: Python v2.6.2 OS: AIX 5.3 I'm using Python to restore some files from
I am trying to copy all files in one location to a different location
I'm trying to write a PowerShell script that will do the following: Executes a
For the last three days I have been trying to develop a web based
I'm trying to use HashSet to store objects of a class that I created,
So, I have a system of stateful processors that are chained together. For example,
I am trying to achieve some thing one these lines ,I have two listboxes
I'm trying to connect to SSH Unix server on button click (code written in
I have a bit of a mess of a file system here at work,
Please help me with this one, I've been writing a console applicaiton using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.