jakubkulhan / bunny

Performant pure-PHP AMQP (RabbitMQ) sync/async (ReactPHP) library
MIT License
698 stars 101 forks source link

InvalidArgumentException on heartbeat set to zero #142

Open 007hacky007 opened 12 months ago

007hacky007 commented 12 months ago

Throws InvalidArgumentException on zero heartbeat.

Setting heartbeat to zero usually means heartbeat is disabled (or value from the server is used) - i.e. https://github.com/php-amqplib/RabbitMqBundle/issues/552

Currently, setting heartbeat to zero in bunny causes DoS on the rabbit server - in my case it caused 1 Mpps rate with 1 Gbps traffic and the CPU load has been maxed out on our rabbit server. So no one realistically wants this behavior.

It took me quite some time to debug this (initially I thought it was caused due to forking and some async issues). I believe I may not be the only one setting this to zero thinking it would disable the heartbeat like on other implementations.