Skip to content
Snippets Groups Projects
Commit a3fc9d30 authored by Mitchell Moore's avatar Mitchell Moore
Browse files

Fix connection parameters for cluster

parent 362c1f8d
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import pika # python client
import pika # python client
import sys
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost')) # connecting to a broker on the local machine
credentials = pika.PlainCredentials('reggie', 'reggie')
parameters = pika.ConnectionParameters('ood',
5672,
'/',
credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.exchange_declare(exchange='direct_logs', exchange_type='direct') # create exchange to pass messages
......@@ -28,7 +33,6 @@ def callback(ch, method, properties, body):
print('[%r] User creation task is done.' % method.routing_key)
channel.basic_consume(
queue=queue_name, on_message_callback=callback, auto_ack=True) # ingest messages, and assume delivered via auto_ack
......
......@@ -2,8 +2,14 @@ import pika
import sys
# Begin RabbitMQ process.
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
credentials = pika.PlainCredentials('reggie', 'reggie')
parameters = pika.ConnectionParameters('ood',
5672,
'/',
credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.exchange_declare(exchange='direct_logs', exchange_type='direct')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment