Handling long running tasks in pika / RabbitMQ

后端 未结 6 571
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 09:26

We\'re trying to set up a basic directed queue system where a producer will generate several tasks and one or more consumers will grab a task at a time, process it, and ackn

6条回答
  •  臣服心动
    2020-12-04 10:05

    For now, your best bet is to turn off heartbeats, this will keep RabbitMQ from closing the connection if you're blocking for too long. I am experimenting with pika's core connection management and IO loop running in a background thread but it's not stable enough to release.

    In pika v1.1.0 this is ConnectionParameters(heartbeat=0)

提交回复
热议问题