<!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;">
Bridge qos_once_and_only_once - XA Recovery - Lost Messages
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/jbosse">Carlo Pacini</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/544495#544495">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 all,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>i'm finding some trouble configuring XA Recovery and bridge with qos _once_and_only_once:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>In this example i've deployed a queue (queuea) on jbm1 bridged with a queue (queueb) on jbm2 using qos once_and_only_once.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Following jbm 1.4.5 user guide, steps are :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>1) Source and destination are on different server -> need to enlist sending and consuming session in JTA Transaction</p><p>2) Both supplied connection factories are XA </p><p>3) Enable XA recovery with JBoss Transaction</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>On jbm1 (ServerPeerID 49) , RemoteJMSProvider definition:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider"><br/>    <attribute name="ProviderName">RemoteJMSProvider</attribute><br/>    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute><br/>    <!-- The combined connection factory --><br/>    <attribute name="FactoryRef">XAConnectionFactory</attribute><br/>    <!-- The queue connection factory --><br/>    <attribute name="QueueFactoryRef">XAConnectionFactory</attribute><br/>    <!-- The topic factory --><br/>    <attribute name="TopicFactoryRef">XAConnectionFactory</attribute><br/>    <attribute name="Properties"><br/>       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory<br/>       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces<br/>       java.naming.provider.url=ip.address.jbm.2:1099<br/>    </attribute><br/>  </mbean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>queuea:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=queuea" xmbean-dd="xmdesc/Queue-xmbean.xml"><br/>    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends><br/>    <depends>jboss.messaging:service=PostOffice</depends><br/>  </mbean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Bridge:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=queueab" xmbean-dd="xmdesc/Bridge-xmbean.xml"><br/>    <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends><br/>    <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends><br/>    <attribute name="SourceDestinationLookup">/queue/queuea</attribute><br/>    <attribute name="TargetDestinationLookup">/queue/queueb</attribute><br/>    <attribute name="QualityOfServiceMode">2</attribute><br/>    <attribute name="MaxBatchSize">1</attribute><br/>    <attribute name="MaxBatchTime">1000</attribute><br/>    <attribute name="FailureRetryInterval">5000</attribute><br/>    <attribute name="MaxRetries">-1</attribute><br/>    <attribute name="AddMessageIDInHeader">false</attribute><br/>  </mbean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>On jbm2 (ServerPeerID 51)  queueb:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=queueb" xmbean-dd="xmdesc/Queue-xmbean.xml"><br/>    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends><br/>    <depends>jboss.messaging:service=PostOffice</depends><br/>  </mbean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Enable XA recovery with JBoss Transactions, added in jbossjta-properties.xml of jbm1 and jbm2:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"<br/>           value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Seems that sending messages to queuea and simulating a crash ( kill -9 pidjbm ) cause that some message are lost and not arrive on queueb.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Step to reproduce:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>- started instances jbm1 and jbm2 (JBoss 4.2.3 with messaging 1.4.5, persistence on oracle db 11.2 ) on different linux server with queue and bridge definition</p><p>- sending 1000 messaging on queuea with jmeter</p><p>- while message are in transit from jbm1 to jbm2 , kill -9 jbm1</p><p>- wait a couple of minutes</p><p>- kill -9 jbm2</p><p>- start  jbm1</p><p>- start  jbm2</p><p>- wait 10 minutes</p><p>- looking on queueb via jmx-console there're 999 messages.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>On db seems there's a stuck transaction:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>SQL> select count(*) from jbm1.jbm_msg;</p><p>  COUNT(*)<br/>----------<br/>         1</p><p>SQL> select count(*) from jbm1.jbm_msg_ref;</p><p>  COUNT(*)<br/>----------<br/>         0</p><p>SQL> select count(*) from  jbm1.jbm_tx;</p><p>  COUNT(*)<br/>----------<br/>         0</p><p>SQL>  select count(*) from  jbm2.jbm_msg;</p><p>  COUNT(*)<br/>----------<br/>      1000</p><p>SQL> select count(*) from  jbm2.jbm_msg_ref;</p><p>  COUNT(*)<br/>----------<br/>      1000</p><p>SQL> select count(*) from  jbm2.jbm_tx;</p><p>  COUNT(*)<br/>----------<br/>         1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>In jbm1 server.log see:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>2010-05-24 13:46:03,483 WARN  [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] [com.arjuna.ats.interna<br/>l.jta.resources.arjunacore.norecoveryxa] Could not find new XAResource to use for recovering non-serializable XAResource < 131075, 29, 27, 1--3f578bcf:b0e5:4<br/>bfa6494:96a-3f578bcf:b0e5:4bfa6494:96b^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@<br/>^@^@^@^@^@^@^@^@^@^@^@^@^@ ></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>or in another case:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>SQL> select count(*) from jbm1.jbm_msg;</p><p>  COUNT(*)<br/>----------<br/>         1</p><p>SQL> select count(*) from jbm1.jbm_msg_ref;</p><p>  COUNT(*)<br/>----------<br/>         1</p><p>SQL> select count(*) from jbm1.jbm_tx;</p><p>  COUNT(*)<br/>----------<br/>         1</p><p>SQL> select count(*) from jbm2.jbm_msg;</p><p>  COUNT(*)<br/>----------<br/>      1000</p><p>SQL> select count(*) from jbm2.jbm_msg_ref;</p><p>  COUNT(*)<br/>----------<br/>      1000</p><p>SQL> select count(*) from jbm2.jbm_tx;</p><p>  COUNT(*)<br/>----------<br/>         1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jbm1 server.log :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>2010-05-24 14:20:46,882 DEBUG [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.notrollback] Told not to rollback < 131075,<br/>1--3f578bcf:e8cc:4bfa6b9d:a2e, -3f578bcf:e8cc:4bfa6b9d:a2f ></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Same behaviour, send 1000 message on queuea, crash, 999 arrive on queueb.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Seems that records remain forever on db  (no tansaction replication nor cleanup), suspect a configuration issue.</p><p>Looking the steps on user guide and on the wiki <a class="" href="http://community.jboss.org/wiki/JBMBridgeConfiguration">http://community.jboss.org/wiki/JBMBridgeConfiguration</a> i've not found the error.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>There're other steps to follow to configure bridge, qos once_and_only_once and xa recovery that i miss?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks in advance,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Carlo</p></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/544495#544495">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>