17 lines
534 B
Python
17 lines
534 B
Python
import pika
|
|
|
|
|
|
def get_channel():
|
|
credentials = pika.PlainCredentials('guest', 'guest')
|
|
conn_params = pika.ConnectionParameters('localhost',
|
|
credentials=credentials)
|
|
channel = pika.BlockingConnection(conn_params).channel()
|
|
channel.exchange_declare(exchange='hello-exchange',
|
|
type='direct',
|
|
passive=False,
|
|
durable=True,
|
|
auto_delete=False)
|
|
|
|
return channel
|
|
|