[rabbitmq-discuss] AMQP heartbeat - Expected behaviors

Matt Pietrek mpietrek at skytap.com
Tue Jul 3 20:17:01 BST 2012


We've recently started using the heartbeat connection option, and I need to
understand them precisely. I understand that both client and server side
can send heartbeat frames, that other activity can substitute for a
heartbeat frame, and that the intervals are negotiated during tuning.

What's confusing me is this:  Some threads such at this one imply that the
server "periodically sends heartbeat frames to the client and waits for its
response."
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-August/014491.html

What exactly is the proper response from the client? I've searched for
hours looking for the format of the response and not found it.

Confounding matters, at least three client libraries I've looked at
(including Pika and .NET) explicitly check for heartbeat frame (i.e., 8)
and then do nothing with them. For instance in the Pika _on_data_available
method():

       while self._frame_buffer:

           # Try and build a frame
           consumed_count, frame =
pika.frame.decode_frame(self._frame_buffer)

           ...

           # We don't check for heartbeat frames because we can not count
           # atomic frames reliably due to different message behaviors
           # such as large content frames being transferred slowly
           elif isinstance(frame, pika.frame.Heartbeat):
               continue


Is this correct behavior or am I simply not understanding how the heartbeat
mechanism is supposed to work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120703/0440e97e/attachment.htm>


More information about the rabbitmq-discuss mailing list