Hi guys, I'm having a serious problem with rabbit and the PHP AMQPLib client.&nbsp;<div><br></div><div>Our system is in essence a state workflow -&gt; events are triggered when we change state in any of our open sessions. We wanted to push processing of those events away from our fron-facing web server, so decided on trying our rabbit to create a pub-sub architecture for async processing of those events.&nbsp;</div><div><br></div><div>Now, those events are not a .. flood of events. We are getting around 10 - 50 per minute, and they are really small in size. We're using a fanout exchange to push them to rabbit, and multi-process them using workers running in another machine.&nbsp;</div><div><br></div><div>Yesterday was our first production test. We left it running for the whole day, until at around 21:00, after more or less 12 hours running ok, rabbit just stopped accepting messages. It was not dead, just not functional.&nbsp;</div><div><br></div><div>As I said, we're using the PhpAmqpLib client. We've written a couple of helper classes, to create a Producer, a PubSubProducer ( the former uses a topic exchange, the latter a fanout one ) and the corresponding Consumers. Can anyone see something wrong in this ?</div><div><br></div><div>The source of the pub-sub producer is more or less this:</div><div><br></div><div>







<p class="p1"><b><span class="s1">public function </span>__construct($exchange_name, $queue_name, $routing_key)&nbsp;</b></p><p class="p1">{</p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp; $this-&gt;<span class="s2">_exchange</span> <span class="Apple-tab-span">        </span>= $exchange_name;</p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$this-&gt;<span class="s2">_queue</span>&nbsp; &nbsp; <span class="Apple-tab-span">        </span>= $queue_name;</p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$this-&gt;<span class="s2">_routing_key</span> = $routing_key;</p>
<p class="p1"><span class="Apple-tab-span">        </span>}</p><p class="p1">







</p><p class="p1"><b>public function <span class="s1">initialize()</span></b></p>
<p class="p2"><span class="Apple-tab-span">        </span>{</p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$config = QueueConfig::instance();</p>
<p class="p3"><span class="Apple-tab-span">        </span><span class="Apple-tab-span">        </span></p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$this-&gt;<span class="s2">_connection</span> = <span class="s3">new </span>AMQPConnection($config-&gt;<span class="s2">host</span>, $config-&gt;<span class="s2">port</span>, $config-&gt;<span class="s2">user</span>, $config-&gt;<span class="s2">pwd</span>, $config-&gt;<span class="s2">vhost</span>);</p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$this-&gt;<span class="s2">_channel</span> = $this-&gt;<span class="s2">_connection</span>-&gt;channel();</p>
<p class="p3"><span class="Apple-tab-span">        </span><span class="Apple-tab-span">        </span></p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span><span class="s3">&nbsp; &nbsp;&nbsp;if</span>(<span class="s3">null</span>!=$this-&gt;<span class="s2">_exchange</span>)</p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;{</p>
<p class="p4"><span class="s1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span></span>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;//echo "Registering Exchange: " . $this-&gt;_exchange;</p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$this-&gt;<span class="s2">_channel</span>-&gt;exchange_declare($this-&gt;<span class="s2">_exchange</span>, <span class="s2">'fanout'</span>);</p>
<p class="p2"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;}</p>
<p class="p2"><span class="Apple-tab-span">        </span>}</p><p></p></div><div>







<p class="p1"><b><span class="s1">public function </span>publish($message, $routing_key = <span class="s1">null</span>, $correlation_id = <span class="s1">null</span>)</b></p>
<p class="p1"><span class="Apple-tab-span">        </span>{</p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$r_key = (<span class="s1">null </span>!= $routing_key)? $routing_key : $this-&gt;<span class="s2">_routing_key</span>;</p>
<p class="p2"><span class="Apple-tab-span">        </span><span class="Apple-tab-span">        </span></p>
<p class="p3"><span class="s3"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$properties = </span><span class="s1">array</span><span class="s3">(</span>'content_type' <span class="s3">=&gt; </span>'text/plain'<span class="s3">, </span>'delivery_mode' <span class="s3">=&gt; 2);</span></p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span><span class="s1">&nbsp; &nbsp;&nbsp;if</span>(<span class="s1">null </span>!= $correlation_id)</p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$properties[<span class="s2">'correlation_id'</span>] = $correlation_id;</p>
<p class="p2"><span class="Apple-tab-span">        </span><span class="Apple-tab-span">        </span></p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$msg = <span class="s1">new </span>AMQPMessage($message, $properties);</p>
<p class="p1"><span class="Apple-tab-span"></span><span class="Apple-tab-span"></span>&nbsp; &nbsp;&nbsp;$this-&gt;<span class="s2">_channel</span>-&gt;basic_publish($msg, $this-&gt;<span class="s2">_exchange</span>, $r_key);</p>
<p class="p1"><span class="Apple-tab-span">        </span>}</p></div><div>Thanks so much for any help guys, very very very much appreciated !&nbsp;<br></div><div><br></div><div>Angel</div>