summaryrefslogtreecommitdiff
path: root/examples/simple_receive.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/simple_receive.py')
-rw-r--r--examples/simple_receive.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/simple_receive.py b/examples/simple_receive.py
index 9d53aa35..e9b933b1 100644
--- a/examples/simple_receive.py
+++ b/examples/simple_receive.py
@@ -4,19 +4,19 @@ Example receiving a message using the SimpleQueue interface.
from __future__ import with_statement
-from kombu import BrokerConnection
+from kombu import Connection
#: Create connection
#: If hostname, userid, password and virtual_host is not specified
#: the values below are the default, but listed here so it can
#: be easily changed.
-with BrokerConnection("amqp://guest:guest@localhost:5672//") as conn:
+with Connection('amqp://guest:guest@localhost:5672//') as conn:
#: SimpleQueue mimics the interface of the Python Queue module.
#: First argument can either be a queue name or a kombu.Queue object.
#: If a name, then the queue will be declared with the name as the queue
#: name, exchange name and routing key.
- with conn.SimpleQueue("kombu_demo") as queue:
+ with conn.SimpleQueue('kombu_demo') as queue:
message = queue.get(block=True, timeout=10)
message.ack()
print(message.payload)