John Mitchell avatar John Mitchell committed 4b0d186

silly

Comments (0)

Files changed (2)

OLD/amqp_consumer.py

-#!/usr/bin/python
-
-from amqplib import client_0_8 as amqp
-
-conn = amqp.Connection(host="localhost:5672", userid="guest", password="guest", virtual_host="/", insist=False)
-chan = conn.channel()
-
-chan.queue_declare(queue="po_box", durable=True, exclusive=False, auto_delete=False)
-chan.exchange_declare(exchange="sorting_room", type="direct", durable=True, auto_delete=False,)
-
-chan.queue_bind(queue="po_box", exchange="sorting_room", routing_key="jason")
-
-def recv_callback(msg):
-    print 'Received: ' + msg.body + ' from channel #' + str(msg.channel.channel_id)
-
-chan.basic_consume(queue='po_box', no_ack=True, callback=recv_callback, consumer_tag="testtag")
-while True:
-    chan.wait()
-chan.basic_cancel("testtag")
-
-
-chan.close()
-conn.close()

OLD/amqp_publisher.py

-#!/usr/bin/python
-
-from amqplib import client_0_8 as amqp
-import sys
-
-conn = amqp.Connection(host="localhost:5672", userid="guest", password="guest", virtual_host="/", insist=False)
-chan = conn.channel()
-
-msg = amqp.Message(sys.argv[1])
-msg.properties["delivery_mode"] = 2
-chan.basic_publish(msg,exchange="sorting_room",routing_key="jason")
-
-chan.close()
-conn.close()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.