Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Always get RabbitMQ queue name from settings.

  • Loading branch information...
commit a4152495d12b1d9499b8db97999eff6e819d553a 1 parent fa1f7da
@calumhalcrow calumhalcrow authored
Showing with 4 additions and 4 deletions.
  1. +1 −2  chat/chatroom.py
  2. +3 −2 frontend/events/signals.py
View
3  chat/chatroom.py
@@ -38,8 +38,7 @@ class PikaClient(Observable):
def __init__(self):
Observable.__init__(self)
- #self.queue_name = settings.RABBITMQ_QUEUE_NAME
- self.queue_name = 'hello'
+ self.queue_name = settings.RABBITMQ_QUEUE_NAME
# States
self.connected = False
View
5 frontend/events/signals.py
@@ -11,9 +11,10 @@ def publish(data):
connection_parameters = PikaClient().connection_parameters()
connection = pika.BlockingConnection(pika.ConnectionParameters(**connection_parameters))
channel = connection.channel()
- channel.queue_declare(queue=settings.RABBITMQ_QUEUE_NAME)
+ queue_name = settings.RABBITMQ_QUEUE_NAME
+ channel.queue_declare(queue=queue_name)
- channel.basic_publish(exchange='', routing_key='hello', body=data)
+ channel.basic_publish(exchange='', routing_key=queue_name, body=data)
print ' [x] Data sent to queue: {0}'.format(data)
connection.close()
Please sign in to comment.
Something went wrong with that request. Please try again.