<!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;">&#160;</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;">&#160;</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;">&#160;</p><p>Following jbm 1.4.5 user guide, steps are :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1) Source and destination are on different server -&gt; 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;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>On jbm1 (ServerPeerID 49) , RemoteJMSProvider definition:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider"&gt;<br/>&#160;&#160;&#160; &lt;attribute name="ProviderName"&gt;RemoteJMSProvider&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="ProviderAdapterClass"&gt;org.jboss.jms.jndi.JNDIProviderAdapter&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;!-- The combined connection factory --&gt;<br/>&#160;&#160;&#160; &lt;attribute name="FactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;!-- The queue connection factory --&gt;<br/>&#160;&#160;&#160; &lt;attribute name="QueueFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;!-- The topic factory --&gt;<br/>&#160;&#160;&#160; &lt;attribute name="TopicFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="Properties"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160; java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory<br/>&#160;&#160;&#160;&#160;&#160;&#160; java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces<br/>&#160;&#160;&#160;&#160;&#160;&#160; java.naming.provider.url=ip.address.jbm.2:1099<br/>&#160;&#160;&#160; &lt;/attribute&gt;<br/>&#160; &lt;/mbean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>queuea:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=queuea" xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;<br/>&#160;&#160;&#160; &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;<br/>&#160;&#160;&#160; &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;<br/>&#160; &lt;/mbean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Bridge:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=queueab" xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;<br/>&#160;&#160;&#160; &lt;depends optional-attribute-name="SourceProviderLoader"&gt;jboss.messaging:service=JMSProviderLoader,name=JMSProvider&lt;/depends&gt;<br/>&#160;&#160;&#160; &lt;depends optional-attribute-name="TargetProviderLoader"&gt;jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider&lt;/depends&gt;<br/>&#160;&#160;&#160; &lt;attribute name="SourceDestinationLookup"&gt;/queue/queuea&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="TargetDestinationLookup"&gt;/queue/queueb&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="QualityOfServiceMode"&gt;2&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="MaxBatchSize"&gt;1&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="MaxBatchTime"&gt;1000&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;<br/>&#160;&#160;&#160; &lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;<br/>&#160; &lt;/mbean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>On jbm2 (ServerPeerID 51)&#160; queueb:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=queueb" xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;<br/>&#160;&#160;&#160; &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;<br/>&#160;&#160;&#160; &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;<br/>&#160; &lt;/mbean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</p><p>&lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</p><p>Step to reproduce:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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&#160; jbm1</p><p>- start&#160; 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;">&#160;</p><p>On db seems there's a stuck transaction:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>SQL&gt; select count(*) from jbm1.jbm_msg;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</p><p>SQL&gt; select count(*) from jbm1.jbm_msg_ref;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0</p><p>SQL&gt; select count(*) from&#160; jbm1.jbm_tx;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0</p><p>SQL&gt;&#160; select count(*) from&#160; jbm2.jbm_msg;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160; 1000</p><p>SQL&gt; select count(*) from&#160; jbm2.jbm_msg_ref;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160; 1000</p><p>SQL&gt; select count(*) from&#160; jbm2.jbm_tx;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In jbm1 server.log see:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2010-05-24 13:46:03,483 WARN&#160; [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 &lt; 131075, 29, 27, 1--3f578bcf:b0e5:4<br/>bfa6494:96a-3f578bcf:b0e5:4bfa6494:96b^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@<br/>^@^@^@^@^@^@^@^@^@^@^@^@^@ &gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>or in another case:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>SQL&gt; select count(*) from jbm1.jbm_msg;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</p><p>SQL&gt; select count(*) from jbm1.jbm_msg_ref;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</p><p>SQL&gt; select count(*) from jbm1.jbm_tx;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</p><p>SQL&gt; select count(*) from jbm2.jbm_msg;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160; 1000</p><p>SQL&gt; select count(*) from jbm2.jbm_msg_ref;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160; 1000</p><p>SQL&gt; select count(*) from jbm2.jbm_tx;</p><p>&#160; COUNT(*)<br/>----------<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>jbm1 server.log :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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 &lt; 131075,<br/>1--3f578bcf:e8cc:4bfa6b9d:a2e, -3f578bcf:e8cc:4bfa6b9d:a2f &gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Same behaviour, send 1000 message on queuea, crash, 999 arrive on queueb.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Seems that records remain forever on db&#160; (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;">&#160;</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;">&#160;</p><p>Thanks in advance,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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>