<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    why JMS server connection can not recover when the socket, which JMS server uses to delivery messages to client, is broken
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/dengyong">yong deng</a> in <i>JBoss Messaging Development</i> - <a href="http://community.jboss.org/message/544953#544953">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>My environment:</p><div id="_mcePaste">JBoss messaging 1.4.0.SP3-CP05 + JBoss remoting 2.2.2.SP10</div><div id="_mcePaste"> </div><div id="_mcePaste"> </div><div> </div><div>My case is like below:</div><div id="_mcePaste">&#160;&#160; I have a JMS client which will subscribe messages from a JMS topic. On the JMS connection, I set an ExceptionListener so that I can detect the connection broken.</div><div id="_mcePaste">&#160;&#160; I did following testing and found some situation JMS connection exception listener can not dectect connection broken.</div><div id="_mcePaste">&#160;&#160; By default, JMS bisocket will listen on port 4457. For every JMS connection, I can find two TCP connection connecting to the port 4457. Besides that, I can find the other two TCP connection which I guess server will use to delivery messages to the clients.</div><div id="_mcePaste">&#160;&#160; 1. when I [only] close TCP connection connecting to the port 4457 use some tools, indeed the ExceptionListener can detect the broken connection</div><div id="_mcePaste">&#160;&#160; 2. but when I [only] close the other two TCP connection, I find:</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160; 1) JMS server will log an exception on ServerInvokerCallbackHandler. After that, it seems will never recover to delivery messages to the clients agains.</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160; On the same handle, the session will still be live in server side, I find this from MBean [jboss.messaging:service=ServerPeer&#160; showActiveClientsAsHTML] from JMX console.</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160; 2) JMS client then can never get message from server side again and also the JMS ExceptionListener on connection can never detect connection failure</div><div> </div><div> </div><div id="_mcePaste"> </div><div id="_mcePaste"> </div><div id="_mcePaste">Now my questions here is:</div><div id="_mcePaste">&#160;&#160; 1. for my case 2, should not the JMS server try to recovery from broken sockets to delivery messages to the JMS client again?</div><div id="_mcePaste">&#160;&#160; 2. for my case 2, if expected behavior can not be implemented, at least JMS connection ExceptionListener should be able to detect failure and reconnect?</div><div> </div></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/544953#544953">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2043">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>