jakubkulhan / bunny

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

Throw exception on too high heartbeat value #98

Closed standa closed 3 years ago

standa commented 3 years ago

When setting the heartbeat value to 1 day (86400), the connections were dropped by RabbitMQ server with the error:

2020-09-25 09:47:25.801 [error] <0.29687.6432> closing AMQP connection <0.29687.6432> (:38384 -> :5672):
missed heartbeats from client, timeout: 20864s
86400 % (2**15)
20864

This has lead us to discrepancy between int16 value sent to RabbitMQ server and the value the client checks (which is still the generic php int/float).

This should be pointed out when constructing the client instance.