Anbarasan
Anbarasan

Reputation: 11

RabbitMQ consumers getting killed after some time

I'm in need of a setup where multiple consumers should listen to a Queue continuously. I am able to start multiple consumers and processing works as expected. But after some time when there are no messages to process, the consumers are getting killed automatically with the below exception message.

No handlers could be found for logger "pika.adapters.base_connection"

Isn't it possible to have a setup where processes that listen to Queue can run continuously ?. I'm using RabbitMQ 3.0.4 and Pika 0.9.13 with Python 2.7.

Please find traceback for the same:

Traceback (most recent call last):
  File "/public/gdp/cms/src/tms/waterfall/worker_waterfall.py", line 675, in <module>
    channel.start_consuming()
  File "build/bdist.linux-x86_64/egg/pika/adapters/blocking_connection.py", line 917, in start_consuming
  File "build/bdist.linux-x86_64/egg/pika/adapters/blocking_connection.py", line 218, in process_data_events
pika.exceptions.ConnectionClosed

Upvotes: 0

Views: 2501

Answers (1)

Gabriele Santomaggio
Gabriele Santomaggio

Reputation: 22750

Read this post : No handlers could be found for logger "pika.adapters.blocking_connection"

Fixed by adding:

import logging
logging.basicConfig()

EDIT

So, I tried to remove the "import logging" from one my Python project and I got your error:

No handlers could be found for logger "pika.adapters.base_connection"

as you can see on the image: enter image description here

then I added the import and it works correctly.

I suppose you have some other problem, could you post your code?

Upvotes: 1

Related Questions