<div class="gmail_extra">Yes. Connection is closed if a heartbeat pulse does not arrive.</div><div class="gmail_extra">You need to open connection again.</div><div class="gmail_extra">The best way (I think) is to let module crash and its supervisor will restart (and reconnect) it.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I have "topRabbitSupervisor", which starts "rabbitConnection" module. </div><div class="gmail_extra">rabbitConnection module opens connection and starts amqp subscribers which use this open connection.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">If any of amqp subscribers lose a connection (heartbeat did not arrive) it crashes, crash propagates to topRabbitSupervisor and
topRabbitSupervisor restarts rabbitConnection which restarts all subscribers then.</div><div class="gmail_extra"><br></div><div class="gmail_extra">It seems it works fine.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Bob<br><br><div class="gmail_quote">Dne 25. dubna 2012 8:40 Max Bourinov <span dir="ltr"><<a href="mailto:bourinov@gmail.com" target="_blank">bourinov@gmail.com</a>></span> napsal(a):<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Tilman!<div><br></div><div>I have it! It is 5 seconds in my case.</div><div><br></div><div><div><font face="'courier new', monospace"><b>{ok, Connection} = amqp_connection:start(</b></font></div><div><font face="'courier new', monospace"><b> #amqp_params_network{</b></font></div>
<div><font face="'courier new', monospace"><b> host = "localhost",</b></font></div><div><font face="'courier new', monospace"><b> username = <<"guest">>,</b></font></div>
<div><font face="'courier new', monospace"><b> password = <<"guest">>,</b></font></div><div><font face="'courier new', monospace"><b> port = 5672,</b></font></div>
<div><font face="'courier new', monospace"><b> virtual_host = <<"/">>,</b></font></div><div><font face="'courier new', monospace"><b> heartbeat = 5</b></font></div>
<div><font face="'courier new', monospace"><b> }),</b></font></div></div><div><br></div><div><br></div><div>Still dropping connections...<div><br></div><div><div>Best regards,</div><div>Max</div><div class="im">
<br><br>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 25, 2012 at 10:36 AM, Tilman Holschuh <span dir="ltr"><<a href="mailto:tilman.holschuh@gmail.com" target="_blank">tilman.holschuh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Max,<br>
<br>
Check out AMQP heartbeat.<br>
<br>
Cheers<br>
- Tilman<br>
<div><div><br>
On 2012-04-24, at 11:26 PM, Max Bourinov wrote:<br>
<br>
> Hi Erlangers,<br>
><br>
> I use forked RabbitMQ client: <a href="https://github.com/jbrisbin/amqp_client" target="_blank">https://github.com/jbrisbin/amqp_client</a><br>
><br>
> While testing it I noticed that if connection is not active for some hours it becomes closed. Interesting thing is that my Erlang app doesn't show any crashes or error messages. SASL is enabled, process that holds connection is under supervision.<br>
><br>
> Does anybody know how RabbitMQ client must be configured to keep connection alive all the time?<br>
><br>
> Best regards,<br>
> Max<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>