<div dir="ltr"><div><div><div>Hi Michael and all, <br><br></div>Unfortunatelly calling the abort function instead of close, will show exactly the same behaviour, as there is still a flush at the end (I also tested this, and indeed not a solution). The only difference is that Exceptions/Stacktraces are ignroed. <br>
</div>The only option I see so far to avoid hanging here, is to set a timeout to the close method. <br><br></div>Regards<br>Claire<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-03 9:18 GMT+01:00 Claire Fautsch <span dir="ltr"><<a href="mailto:cfautsch@goodgamestudios.com" target="_blank">cfautsch@goodgamestudios.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Hi, </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">we have following issue with blocking queues: </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Once the memory watermark is reached, the connection from the client gets blocked by the RabbitMQ server and it is no longer possible to publish messages. </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">If this happens, we are for some time still able to publish  messages, however they remain in the socket’s write buffer and are not actually published until the connection is un-blocked again. Once this buffer is full, publishing blocks completely. </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">After some research we found out, that with a newer version of the official Java client, it is possible to use blocked connection notifications to react on this situation.  </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Our prefered reaction would be to close the connection, and re-connect to another broker. Here however comes the problem: It is not possible to close the connection to the RabbitMQ, as the method to do so, involves a flush on the socket before the socket is closed and this is blocked as well. </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Is there any possibility for a force-closed on the client side? Or is the only possibility to open a new connection without closing the old one, and “let it die”? </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Re-writing the SocketFrameHandler would of course also be a  possibility, but one we would (if possible) like to avoid. (see also discussion here : </span><a href="https://github.com/rabbitmq/rabbitmq-java-client/issues/11" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline">https://github.com/rabbitmq/rabbitmq-java-client/issues/11</span></a><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">)</span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"><br></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Additionally, when we see blocking connections occurring, we frequently see following stack trace in our logs, where we are not absolutely sure where it comes from, or rather why it occurs </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"> </span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.io.EOFException</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:37)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:349)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:569)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:501)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">...</span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Caused by: java.io.EOFException</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:494)at java.io.DataInputStream.readUnsignedByte(Unknown Source)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:515)</span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"><br></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">For information, we are currently using Java client, com.rabbitmq:amqp-client version 3.1.4</span></p>

<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">and com.zanox.lib.rabbiteasy version:rabbiteasy-core version 1.2.0, for the connection handling (SingleConnectionFactory) and publishing. </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Thanks in advance for any hint or ideas. </span></p>

<br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Regards</span></p><span class="HOEnZb"><font color="#888888"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">

<span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal">Claire</span></p><br><span style="vertical-align:baseline;font-variant:normal;font-style:normal;font-size:15px;background-color:transparent;text-decoration:none;font-family:Arial;font-weight:normal"></span><br>

<div dir="ltr"><div style="font-family:arial,sans-serif"><div><font color="#000000"><span style="font-size:x-small"><span>    <span>    <span>    <span>  <span>      </span> <span>    </span></span></span></span></span></span><font style="font-size:x-small"> </font><br>

<span style="font-size:x-small">    <span>    <span>    <span>  <span>    </span>   <span>    </span></span></span></span><br></span></font></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">
<p style="margin-bottom:0.0001pt;line-height:normal"><b style="font-size:10pt;color:rgb(34,34,34);font-family:arial,sans-serif"><span><span><span><span><span></span></span></span></span></span><font>Claire Fautsch</font><br>
</b></p><span style="color:rgb(0,0,0);font-family:arial,sans-serif"><span><span><span><span></span></span></span></span>Server Developer<br><a href="mailto:cfautsch@goodgamestudios.com" target="_blank">cfautsch@goodgamestudios.com</a><br>
</span><br><font color="#222222">Goodgame Studios</font><div style="font-family:arial,sans-serif"><span style="color:rgb(0,0,255)"><font color="#222222">Theodorstr. 42-90, House 9<br></font></span><span style="color:rgb(0,0,255)"><font color="#222222">22761 Hamburg, Germany<br>
</font></span><span style="color:rgb(0,0,255)"><font color="#222222">Phone: +49 (0)40 219 880 -0</font>              <span>    </span>  </span><br><br><span style="color:rgb(0,137,201)"><font color="#0000ff"><u><a href="http://www.goodgamestudios.com" target="_blank">www.goodgamestudios.com</a></u></font></span><font color="#222222">    </font><span style="color:rgb(34,34,34)">    <span>    <span>    </span><span>    </span></span></span><br>
<font color="#222222">    </font><span style="color:rgb(34,34,34)">    <span>    <span>    </span><span>    </span></span></span><br><font color="#222222"><span style="font-size:x-small"><font color="#000000">Goodgame Studios is a branch of Altigi GmbH </font></span><font color="#000000"><br>
</font></font><font color="#222222"><font color="#000000"><span style="font-size:x-small">A</span><font style="font-size:x-small">ltigi GmbH, District court Hamburg, HRB 99869<br></font></font></font><font color="#222222"><font color="#000000"><span style="font-size:x-small">Board of directors: Dr. Kai Wawrzinek, Dr. Christian Wawrzinek, Fabian Ritter</span></font>   </font><span style="color:rgb(34,34,34)">    <span>   <span>    </span> <span>    </span></span></span><br>
<font color="#222222">    </font><span style="color:rgb(34,34,34)">    <span>  <span>    </span>  <span>    </span></span></span><br><span style="color:rgb(0,137,201)"><font color="#0000ff">           <span>    </span>     </font></span><br>
<div><font style="color:rgb(80,0,80)" color="#0089c9" face="arial, sans-serif"><br></font><span style="font-size:x-small"><font color="#500050">                 </font><span style="color:rgb(80,0,80)">  </span><span style="color:rgb(80,0,80)">   </span><font color="#500050">   </font><font color="#000000"></font></span><font color="#000000"><br>
<span style="font-size:x-small"><span>    <span>    <span>    <span>  <span>      </span> <span>    </span></span></span></span></span></span><font style="font-size:x-small"> </font><br><span style="font-size:x-small">    <span>    <span>    <span>  <span>    </span>   <span>    </span></span></span></span><br>
</span></font></div></div></div>
</div>