<!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">JBoss 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;">
    Failover for JMS client takes too long and fail
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/fharms">Flemming Harms</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/625856#625856">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have problem I don't know how to solve. Sometimes the JMS client take to long to failover and throw an exception on the client, this is not consistent but something we can reproduce 6-10 times.<br/>The servers is not stressed at all and the same goes for the client.<br/> <br/></p><div>- 2 JBoss 5.1 servers running in a cluster<p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>- 2 clients connect to a topic queue<br/>- Messaging client 1.4.7.GA<br/>- remoting 2.5.1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1) if I use the default values "remote-sslbisocket-service.xml" our client thinks it's should failover on startup. This fail with an JMSException and In this case we reconnect to the topic and after this every thing works fine. if I bring down one of the servers, it fail over as expected. But because it fail on startup there is possibility we miss messages because it use a minute to discover the failover didn't work&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div>2) if I change the values validatorPingTimeout to 10000 and validatorPingPeriod = 15000 we are able to start our client with out the JMS client thinks it should failover and messages are received. But if I bring down one of the two servers it fail in the failover procedure with an JMSExeception<p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div><div><span style="font-size: 8pt;">2011-09-10 07:37:11,801 [Thread-213] WARN&#160; com.apc.dsmf.client.webservices.event.QueueRemoteEventServiceImpl - Failover event FAILURE_DETECTED</span><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 8pt;">2011-09-10 07:37:11,807 [Thread-213] WARN&#160; com.apc.dsmf.client.webservices.event.QueueRemoteEventServiceImpl - Failover event FAILOVER_STARTED</span></p><p><span style="font-size: 8pt;">2011-09-10 07:38:19,319 [Thread-213] WARN&#160; com.apc.dsmf.client.webservices.event.QueueRemoteEventServiceImpl - Failover event FAILOVER_FAILED</span></p><p><span style="font-size: 8pt;">2011-09-10 07:38:19,321 [Thread-213] ERROR com.apc.dsmf.client.webservices.event.QueueRemoteEventServiceImpl - Got JMS Exception</span></p><p><span style="font-size: 8pt;">javax.jms.JMSException: Failure on underlying remoting connection</span></p><p><span style="font-size: 8pt;">&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.jboss.jms.client.remoting.ConsolidatedRemotingConnectionListener.handleConnectionException(ConsolidatedRemotingConnectionListener.java:99)</span></p><p><span style="font-size: 8pt;">&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.jboss.remoting.ConnectionValidator$1.run(ConnectionValidator.java:498)</span></p></div></div><p><span style="font-size: 8pt;">client code :</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>TopicConnection connection = ((TopicConnectionFactory) lookup).createTopicConnection();session = connection.createTopicSession(true,Session.AUTO_ACKNOWLEDGE);Topic topic = (Topic) context.lookup(JNDI_NAME_REMOTE_EVENT_TOPIC);subscriber = session.createSubscriber(topic);subscriber.setMessageListener(this);connection.setExceptionListener(this);((JBossConnection) connection).registerFailoverListener(this);connection.start();</p><div><p>---------------------------------------------------------------</p></div><p>remote-sslbisocket-service.xml :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div> &lt;mbean code="org.jboss.remoting.transport.Connector"<p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name="jboss.messaging:service=Connector,transport=sslbisocket"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; display-name="SSL Bisocket Transport Connector"&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;attribute name="Configuration"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;config&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;invoker transport="sslbisocket"&gt;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- There should be no reason to change these parameters - warning!</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Changing them may stop JBoss Messaging working correctly --&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="marshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="unmarshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="serverBindPort"&gt;4459&lt;/attribute&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="clientSocketClass" isParam="true"&gt;org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="serverSocketClass"&gt;org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="serverSocketFactory"&gt;jboss.messaging:service=ServerSocketFactory,type=SSL&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="clientConnectAddress"&gt;10.245.256.10&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="onewayThreadPool"&gt;org.jboss.jms.server.remoting.DirectThreadPool&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- the following parameters are useful when there is a firewall between client and server. Uncomment them if so.--&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="numberOfCallRetries" isParam="true"&gt;5&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="pingFrequency" isParam="true"&gt;30000&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="pingWindowFactor" isParam="true"&gt;71582&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="generalizeSocketException" isParam="true"&gt;true&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Now remoting supports socket write timeout configuration. Uncomment this if you need it. --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!--&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="writeTimeout" isParam="true"&gt;30000&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- End immutable parameters --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="stopLeaseOnFailure" isParam="true"&gt;true&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Periodicity of client pings. Server window by default is twice this figure --&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="clientLeasePeriod" isParam="true"&gt;10000&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="validatorPingPeriod" isParam="true"&gt;10000&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="validatorPingTimeout" isParam="true"&gt;5000&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="failureDisconnectTimeout" isParam="true"&gt;0&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="callbackErrorsAllowed"&gt;1&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="registerCallbackListener"&gt;false&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="useClientConnectionIdentity" isParam="true"&gt;true&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Max Number of connections in client pool. This should be significantly higher than</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; the max number of sessions/consumers you expect --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="JBM_clientMaxPoolSize" isParam="true"&gt;200&lt;/attribute&gt; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- The maximum time to wait before timing out on trying to write a message to socket for delivery --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="callbackTimeout"&gt;10000&lt;/attribute&gt; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Use these parameters to specify values for binding and connecting control connections to </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; work with your firewall/NAT configuration --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="secondaryBindPort"&gt;4462&lt;/attribute&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;attribute name="secondaryConnectPort"&gt;4462&lt;/attribute&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/invoker&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;handlers&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/handlers&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/config&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends&gt;jboss.messaging:service=ServerSocketFactory,type=SSL&lt;/depends&gt;</p><p>&#160;&#160; &lt;/mbean&gt;</p></div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div>Catch 22, please help!!!<p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></div><p>br</p><p>Flemming</p></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/625856#625856">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>