Skip to content

Commit

Permalink
update twisted example
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Oct 10, 2017
1 parent 046600d commit 6baad8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/twisted_service.py
Expand Up @@ -90,7 +90,7 @@ def read(self, exchange, routing_key, callback):
def setup_read(self, exchange, routing_key, callback):
"""This function does the work to read from an exchange."""
if not exchange == '':
yield self.channel.exchange_declare(exchange=exchange, type='topic', durable=True, auto_delete=False)
yield self.channel.exchange_declare(exchange=exchange, exchange_type='topic', durable=True, auto_delete=False)

self.channel.queue_declare(queue=routing_key, durable=True)

Expand Down Expand Up @@ -127,7 +127,7 @@ def send(self):
def send_message(self, exchange, routing_key, msg):
"""Send a single message."""
log.msg('%s (%s): %s' % (exchange, routing_key, repr(msg)), system='Pika:=>')
yield self.channel.exchange_declare(exchange=exchange, type='topic', durable=True, auto_delete=False)
yield self.channel.exchange_declare(exchange=exchange, exchange_type='topic', durable=True, auto_delete=False)
prop = spec.BasicProperties(delivery_mode=2)
try:
yield self.channel.basic_publish(exchange=exchange, routing_key=routing_key, body=msg, properties=prop)
Expand Down

1 comment on commit 6baad8e

@sanderfoobar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Please sign in to comment.