Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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</p> <p>In the sending code:</p> <pre><code>conn.send(str(i), exchange=exchange, destination='') </code></pre> <p>The blank destination is required, all I care about is sending to that exchange</p> <p>To recieve</p> <pre><code>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() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload