can both consuming and publishing be done in one Python thread using RabbitMQ channels?
can both consuming and publishing be done in one Python thread using RabbitMQ channels?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually this isn’t a problem at all and you can do it quite easily with for example
pikathe problem is however that you’d have to stop the consuming since it’s a blocking loop or do the producing during the consume of a message.Consuming and producing is a normal usecase, especially in pika since it isn’t threadsafe, when for example you’d want to implement some form of filter on the messages, or, perhaps a smart router, which in turn will pass on the messages to another queue.