parent
1120412e45
commit
26ec865dd7
@ -0,0 +1,16 @@
|
||||
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
|
||||
|
Loading…
Reference in new issue