I&#39;m trying to understand how RabbitMQ behaves under failure conditions, specifically when using the Net::RabbitMQ Perl module.<br><br>We have RabbitMQ set up with three nodes, one on the backend, which holds the actual queues, and two on the frontend, which receive publish requests.<br>
<br>RabbitMQ 2.2.0<br>Net::RabbitMQ 0.1.8<br><br><br>Below is the chart of behaviors that I have observed.<br><br>&quot;+&quot; means the behavior is as I expected: either the message is successfully queued, or an error is thrown.<br>
&quot;-&quot; means the behavior is not as I expected, but can be managed: specifically, the process receives a SIGPIPE, which I can trap and recover from.<br>&quot;!&quot; means the behavior is not as I expected, and cannot be managed: the message is not queued but no error is thrown and/or the process hangs.<br>
<br>&quot;App down&quot; means I ran `rabbitmqctl stop_app`.� &quot;Daemon down&quot; means I ran `rabbitmqctl stop`.<br><br>� As publishing process starts up:<br><br>��� Remote daemon up, app up<br>����� + Everything okay<br>
<br>��� Remote daemon up, app down<br>����� ! Net::RabbitMQ hangs when declaring queue<br><br>��� Remote daemon down<br>����� + Net::RabbitMQ throws error when declaring queue<br>������� &quot;Declaring queue: server channel error 404, message: NOT_FOUND - no queue &#39;test&#39; in vhost &#39;/&#39;&quot;<br>
<br>��� Local daemon up, app down<br>����� + Net::RabbitMQ throws error when connecting<br>������� &quot;Opening socket: Connection refused&quot;<br><br>��� Local daemon down<br>����� + Net::RabbitMQ throws error when connecting<br>
������� &quot;Opening socket: Connection refused&quot;<br><br><br>� After publishing process starts up:<br><br>��� Local app goes down<br>����� - Process receives SIGPIPE<br><br>��� Local daemon goes down<br>����� - Process receives SIGPIPE<br>
<br>��� Remote app goes down<br>����� ! Net::RabbitMQ falsely indicates success when publishing, then hangs (in DESTROY?)<br><br>��� Remote daemon goes down<br>����� ! Net::RabbitMQ falsely indicates success when publishing<br>
<br><br>��� Local app goes down, comes back up<br>����� - Process receives SIGPIPE<br><br>��� Local daemon goes down, comes back up<br>����� - Process receives SIGPIPE<br><br>��� Remote app goes down, comes back up<br>����� + Everything okay<br>
<br>��� Remote daemon goes down, comes back up<br>����� + Everything okay<br><br><br>Have other people had these problems with Net::RabbitMQ?� Can we resolve these issues by changing something in our RabbitMQ configuration?<br>
<br><br>thanks,<br>Ronald<br><br><br>P.S. Here&#39;s my script.<br><br>#!/usr/local/bin/perl<br><br>use strict;<br>use warnings;<br><br>use Net::RabbitMQ;<br><br>$| = 1;<br><br>$SIG{&#39;PIPE&#39;} = sub { die &quot;SIGPIPE\n&quot; };<br>
<br>my $mq = Net::RabbitMQ-&gt;new();<br><br>alarm(10);<br><br>print &quot;Connecting\n&quot;;<br>$mq-&gt;connect(&#39;localhost&#39;, { user =&gt; &#39;engagement&#39;, password =&gt; &#39;********&#39; })<br>� or die &quot;Can&#39;t connect to RabbitMQ\n&quot;;<br>
<br>print &quot;Opening channel\n&quot;;<br>$mq-&gt;channel_open(1);<br><br>print &quot;Declaring exchange\n&quot;;<br>$mq-&gt;exchange_declare(1, &#39;ee_exchange&#39;, { durable =&gt; 1 });<br><br>print &quot;Declaring queue\n&quot;;<br>
$mq-&gt;queue_declare(1, &#39;test&#39;, { durable =&gt; 1 });<br><br>print &quot;Binding queue\n&quot;;<br>$mq-&gt;queue_bind(1, &#39;test&#39;, &#39;ee_exchange&#39;, &#39;ee_test&#39;);<br><br>alarm(0);<br><br>print &quot;&gt; &quot;;<br>
&lt;&gt;;<br><br>alarm(10);<br><br>print &quot;Publishing message\n&quot;;<br>my $rc =<br>� $mq-&gt;publish(1, &#39;ee_test&#39;, &#39;hello world!&#39;,<br>�������������� { exchange =&gt; &#39;ee_exchange&#39;, mandatory =&gt; 1, immediate =&gt; 0 },<br>
�������������� { delivery_mode =&gt; 2 });<br>print &quot;Result: $rc\n&quot;;<br><br>__END__<br><br>