Normal flow of read message, do something with the message, and then write the message to another queue #1427
mikeoliversinag
started this conversation in
General
Replies: 2 comments
-
I have a similar request for an example of that kind of flow from MQ to process the message to write to a different queue |
Beta Was this translation helpful? Give feedback.
0 replies
-
Simple is as simple does.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to build a python component that uses Pika to get messages from a queue, do some processing on the message fetched, then write the processed message to another queue.
I reading through the examples it looked like the Asynchronous Consume and Asynchronous Publish examples were the most robust and I tried to use them.
`def on_message(self, _unused_channel, basic_deliver, properties, body):
"""Invoked by pika when a message is delivered from RabbitMQ. The
channel is passed for your convenience. The basic_deliver object that
is passed in carries the exchange, routing key, delivery tag and
a redelivered flag for the message. The properties passed in is an
instance of BasicProperties with the message properties and the body
is the message that was sent.
in the Asynchronous Consume example, is where I thought I could get access to the message to process it. At the end of the processIt(body) script I call the Asynchronous Publish.
Without the >>>>> line the Asynchrous Consume does fine, it fetches all the messages in the queue. But when I add that line either before or after the ack it only reads one message and writes one message and stops.
Is there an example of what I perceive as a common use of Pika to read a message, process it and write it to another queue?
Beta Was this translation helpful? Give feedback.
All reactions