<!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;"> </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;"> </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;"> </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  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><div><div><span style="font-size: 8pt;">2011-09-10 07:37:11,801 [Thread-213] WARN  com.apc.dsmf.client.webservices.event.QueueRemoteEventServiceImpl - Failover event FAILURE_DETECTED</span><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 8pt;">2011-09-10 07:37:11,807 [Thread-213] WARN  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  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;">          at org.jboss.jms.client.remoting.ConsolidatedRemotingConnectionListener.handleConnectionException(ConsolidatedRemotingConnectionListener.java:99)</span></p><p><span style="font-size: 8pt;">          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;"> </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;"> </p><div> <mbean code="org.jboss.remoting.transport.Connector"<p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>          name="jboss.messaging:service=Connector,transport=sslbisocket"</p><p>          display-name="SSL Bisocket Transport Connector"></p><p>      <attribute name="Configuration"></p><p>         <config></p><p>            <invoker transport="sslbisocket">   </p><p>            </p><p>               <!-- There should be no reason to change these parameters - warning!</p><p>                    Changing them may stop JBoss Messaging working correctly -->          </p><p>               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute></p><p>               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute></p><p>               <attribute name="dataType" isParam="true">jms</attribute></p><p>               <attribute name="socket.check_connection" isParam="true">false</attribute>              </p><p>                 <attribute name="serverBindAddress">${jboss.bind.address}</attribute></p><p>               <attribute name="serverBindPort">4459</attribute>               </p><p>               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute></p><p>               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute></p><p>               <attribute name="serverSocketFactory">jboss.messaging:service=ServerSocketFactory,type=SSL</attribute></p><p>                 <attribute name="clientConnectAddress">10.245.256.10</attribute></p><p>               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute></p><p>               <!-- the following parameters are useful when there is a firewall between client and server. Uncomment them if so.--></p><p>                                </p><p>               <attribute name="numberOfCallRetries" isParam="true">5</attribute></p><p>               <attribute name="pingFrequency" isParam="true">30000</attribute></p><p>               <attribute name="pingWindowFactor" isParam="true">71582</attribute></p><p>               <attribute name="generalizeSocketException" isParam="true">true</attribute></p><p>               </p><p>               <!-- Now remoting supports socket write timeout configuration. Uncomment this if you need it. --></p><p>               <!--               </p><p>               <attribute name="writeTimeout" isParam="true">30000</attribute></p><p>               --></p><p>               <!-- End immutable parameters --></p><p>               </p><p>               <attribute name="stopLeaseOnFailure" isParam="true">true</attribute></p><p>                              </p><p>               <!-- Periodicity of client pings. Server window by default is twice this figure -->                               </p><p>               <attribute name="clientLeasePeriod" isParam="true">10000</attribute></p><p>               <attribute name="validatorPingPeriod" isParam="true">10000</attribute></p><p>               <attribute name="validatorPingTimeout" isParam="true">5000</attribute></p><p>               <attribute name="failureDisconnectTimeout" isParam="true">0</attribute></p><p>               <attribute name="callbackErrorsAllowed">1</attribute></p><p>               <attribute name="registerCallbackListener">false</attribute></p><p>               <attribute name="useClientConnectionIdentity" isParam="true">true</attribute></p><p>                 </p><p>                 <attribute name="timeout" isParam="true">0</attribute></p><p>               <!-- Max Number of connections in client pool. This should be significantly higher than</p><p>                    the max number of sessions/consumers you expect --></p><p>               <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute> </p><p>               </p><p>                 <!-- The maximum time to wait before timing out on trying to write a message to socket for delivery --></p><p>               <attribute name="callbackTimeout">10000</attribute> </p><p>                                                    </p><p>               <!-- Use these parameters to specify values for binding and connecting control connections to </p><p>                    work with your firewall/NAT configuration --></p><p>               <attribute name="secondaryBindPort">4462</attribute>                           </p><p>               <attribute name="secondaryConnectPort">4462</attribute>                              </p><p>               </p><p>            </invoker></p><p>            <handlers></p><p>               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler></p><p>            </handlers></p><p>         </config></p><p>      </attribute></p><p>      <depends>jboss.messaging:service=ServerSocketFactory,type=SSL</depends></p><p>   </mbean></p></div><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><div>Catch 22, please help!!!<p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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>