Skip to content

Commit

Permalink
New subscriber example
Browse files Browse the repository at this point in the history
Subscriber example rewritted to show new form of event handler protocol.
(subscriber.subscribe_on_thread() will now pass rabbitpy.message objects to the event_listener. NOT the message.body string.)
  • Loading branch information
gabriel10619 authored Jul 21, 2021
1 parent 0edd238 commit 35fb6f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/publish_subscribe/subscriber.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from b_rabbit import BRabbit


def event_listener(body):
def event_listener(msg):
print('Event received')
print(str(body))
print("Message body is: " + msg.body)
print("Message properties are: " + str(msg.properties))


rabbit = BRabbit(host='localhost', port=5672)
Expand Down

0 comments on commit 35fb6f7

Please sign in to comment.