Open achalkov opened 8 years ago
You can use the heartbeat
parameter to enable heartbeats on the client side. However, note that according to the documentation of the AMQP library we are using, the functionality is limited:
Note rabbitmq-c only has partial support for heartbeats, as of v0.4.0 they are only serviced during amqp_basic_publish() and amqp_simple_wait_frame()/amqp_simple_wait_frame_noblock()
This means that the library only sends heartbeats frames when you actually publish something and wait for an reply.
In order to implement this properly, we probably need to bypass the library and find a workaround to send raw AMQP packets to the server. I will look into this.
Currently, event-rabbitmq can use heartbeat, but only by receiving heartbeat-requests, but by the amqp specifications (https://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf p.4.2.7), rabbitmq-client also should send heartbeat requests in configured intervals. In case of that, rabbitmq-server with configured heartbeat interval, sometimes drops connection with opensips. To avoid that we should be capable to send amqp-heartbeats too.