<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"><title>Handling network reliability problems on the publisher side</title>
</head>
<body>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">Hi everyone,<br>
<br>
as some of you may know, we�ve aimed at building a highly reliable messaging infrastructure around the idea of publishing messages redundantly to a number of identical rabbitmq instances along with deduplicating messages on the receiver side. (see <a href="http://xing.github.com/beetle/">http://xing.github.com/beetle/</a>, <a href="https://github.com/xing/beetle">https://github.com/xing/beetle</a> and <a href="https://github.com/xing/perl-beetle">https://github.com/xing/perl-beetle</a>).<br>
<br>
The system has been in use in our production environment since April, and we were quite happy with it.<br>
<br>
However, we recently had an incident which points to a weakness of our solution: we experienced a temporary network routing problem, which separated at least one of the rabbitmq servers from the publishing processes (mainly or web application). The separation lasted several minutes and lead to parts of our web application blocking in socket writes. In the end, our administrators restarted the web app.<br>
<br>
It turned out that we lost quite a few messages, and here�s why: the publisher blocks only after the TCP buffers have been filled completely (even though TCP_NODELAY and SO_SNDTIMEO are set on the socket).<br>
<br>
It looks like no programming cleverness on our side can achieve what we want: have the publisher block as soon as a message cannot be accepted by the intended rabbitmq server, because, as far as we understand the amqp protocol, no protocol level acknowledgements are sent which the publisher could wait for (and optionally timeout), before sending the next message.<br>
<br>
This is all fine to achieve high throughput on the publisher side, but doesn�t quite fit our use case. For some messages, we really need to make reasonably sure the message has been received by a rabbitmq server, before we continue. We could then use timeouts to detect network partitioning and buffer messages locally until they can be sent (only if none of our three redundant servers can be reached, of course).<br>
<br>
Turning on heartbeats can improve the situation somewhat, in that failures can be detected earlier, but since heartbeats are asynchronous in nature, they don�t fully solve our problem.<br>
<br>
It currently seems as if the only way to get what we want is to switch our publishers to use the JSON-RPC plugin for rabbitmq.<br>
<br>
I�d be interested to here what you think about the problem:<br>
<br>
</span></font><ul><li><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">is the analysis correct?
</span></font><li><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">is the JSON-RPC plugin stable enough to be used in production?
</span></font><li><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">maybe there�s a better solution available?<br>
</span></font></ul><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt"><br>
<br>
Regards,<br>
<br>
-- stefan<br>
<br>
<br>
<br>
Dr. Stefan Kaes<br>
Principal System Architect<br>
&nbsp;<br>
XING AG<br>
Gaensemarkt 43, 20354 Hamburg, Germany<br>
Tel. &#43;49 40 419131-801, Fax &#43;49 40 419131-11<br>
&nbsp;<br>
Commercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807<br>
Exec. Board (Vorstand): Dr. Stefan Gro�-Selbeck (Vorsitzender), Ingo Chu, Burkhard Blum, Michael Otto, Dr. Helmut Becker<br>
Chairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil Sunderland<br>
&nbsp;<br>
Please join my network on XING: <a href="http://www.xing.com/go/invite/Stefan.Kaes">http://www.xing.com/go/invite/Stefan.Kaes</a><br>
<br>
This email may contain confidential and/or privileged information. If you are not the intended recipient (or have received this email in error) please notify the sender immediately and destroy this email. Any unauthorized copying, disclosure or distribution of the material in this email is strictly forbidden and may be unlawful.<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span></font>
</body>
</html>