6 Replies Latest reply on Nov 5, 2010 5:21 PM by Clebert Suconic

    jms-bridge not delivering messages

    Lennart Petersson Novice

      JMS-Bridge between 2 JBoss AS 5 with HornetQ 2.1.2 instances. Both servers up and running. Sending a message to source destination. Nothing happens in the target destination. If i bring the JMS bridge up in jmx-console and first stop it and then start it again, then the message is fetched from the source to the target destination. Whats up??

       

      Here is the conf of the bridge:

       

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

       

      <!-- HornetQ JMS Bridge -->

       

      <deployment xmlns="urn:jboss:bean-deployer:2.0">

       

             <bean name="livGetPersonReplyBridge" class="org.hornetq.jms.bridge.impl.JMSBridgeImpl">
                 <!-- HornetQ must be started before the bridge -->
                 <depends>HornetQServer</depends>
                 <constructor>
                     <!-- Source ConnectionFactory Factory -->
                     <parameter>
                         <inject bean="SourceCFF"/>
                     </parameter>
                     <!-- Target ConnectionFactory Factory -->
                     <parameter>
                         <inject bean="TargetCFF"/>
                     </parameter>
                     <!-- Source DestinationFactory -->
                     <parameter>
                         <inject bean="SourceDestinationFactory"/>
                     </parameter>
                     <!-- Target DestinationFactory -->
                     <parameter>
                         <inject bean="TargetDestinationFactory"/>
                     </parameter>
                     <!-- Source User Name (<null/> if no user name) -->
                     <parameter><null/></parameter>
                     <!-- Source Password (<null/> if no pasword) -->
                     <parameter><null/></parameter>
                     <!-- Target User Name (<null/> if no user name) -->
                     <parameter><null/></parameter>
                     <!-- Target Password (<null/> if no pasword) -->
                     <parameter><null/></parameter>
                     <!-- Selector -->
                     <parameter><null /></parameter>
                     <!-- Failure Retry Interval (in ms) -->
                     <parameter>5000</parameter>
                     <!-- Max Retries (-1 means retry forever)-->
                     <parameter>-1</parameter>
                     <!-- Quality Of Service -->
                     <parameter>DUPLICATES_OK</parameter>
                     <!-- Max Batch Size -->
                     <parameter>1</parameter>
                     <!-- Max Batch Time (-1 means infinite) -->
                     <parameter>1</parameter>
                     <!-- Subscription name (no subscription name here)-->
                     <parameter><null /></parameter>
                     <!-- Client ID  (no client ID here)-->
                     <parameter><null /></parameter>
                     <!-- Add MessageID In Header -->
                     <parameter>false</parameter>
                     <!-- register the JMS Bridge in the JMX MBeanServer -->
                     <parameter>
                         <inject bean="MBeanServer"/>
                     </parameter>
                     <parameter>testing:service=JMSBridge</parameter>
                 </constructor>
                 <property name="transactionManager">
                     <inject bean="RealTransactionManager"/>
                 </property>
             </bean>

       

             <!-- SourceCFF describes the ConnectionFactory used to connect to the
                  source destination -->
             <bean name="SourceCFF"
                  class="org.hornetq.jms.bridge.impl.JNDIConnectionFactoryFactory">
                 <constructor>
                     <parameter>
                         <inject bean="JNDI-outer" />
                     </parameter>
                     <parameter>/ConnectionFactory</parameter>
                 </constructor> 
             </bean>

       

             <!-- TargetCFF describes the ConnectionFactory used to connect to the
              target destination -->
             <bean name="TargetCFF"
                  class="org.hornetq.jms.bridge.impl.JNDIConnectionFactoryFactory">
                 <constructor>
                     <parameter>
                         <inject bean="JNDI-inner" />
                     </parameter>
                     <parameter>/ConnectionFactory</parameter>
                 </constructor> 
             </bean>

       

             <!-- SourceDestinationFactory describes the Destination used as the source -->
             <bean name="SourceDestinationFactory"
                  class="org.hornetq.jms.bridge.impl.JNDIDestinationFactory">
                 <constructor>
                     <parameter>
                         <inject bean="JNDI-outer" />
                     </parameter>
                     <parameter>/queue/source</parameter>
                 </constructor> 
             </bean>

       

             <!-- TargetDestinationFactory describes the Destination used as the target -->
             <bean name="TargetDestinationFactory"
                  class="org.hornetq.jms.bridge.impl.JNDIDestinationFactory">
                 <constructor>
                     <parameter>
                         <inject bean="JNDI-inner" />
                     </parameter>
                     <parameter>/queue/destination</parameter>
                 </constructor> 
             </bean>
            
             <!-- JNDI is a Hashtable containing the JNDI properties required -->
             <!-- to connect to the sources and targets JMS resrouces         -->      
            <bean name="JNDI-outer" class="java.util.Hashtable">
               <constructor class="java.util.Map">
                  <map class="java.util.Hashtable" keyClass="java.lang.String"
                                                   valueClass="java.lang.String">
                     <entry>
                        <key>java.naming.factory.initial</key>
                        <value>org.jnp.interfaces.NamingContextFactory</value>
                     </entry>
                     <entry>
                        <key>java.naming.provider.url</key>
                        <value>jnp://outer.liv.local:1099</value>
                     </entry>
                     <entry>
                        <key>java.naming.factory.url.pkgs</key>
                        <value>org.jboss.naming:org.jnp.interfaces"</value>
                     </entry>
                     <entry>
                        <key>jnp.timeout</key>
                        <value>5000</value>
                     </entry>
                     <entry>
                        <key>jnp.sotimeout</key>
                        <value>5000</value>
                     </entry>
                  </map>
               </constructor>
            </bean>
            <bean name="JNDI-inner" class="java.util.Hashtable">
               <constructor class="java.util.Map">
                  <map class="java.util.Hashtable" keyClass="java.lang.String"
                                                   valueClass="java.lang.String">
                     <entry>
                        <key>java.naming.factory.initial</key>
                        <value>org.jnp.interfaces.NamingContextFactory</value>
                     </entry>
                     <entry>
                        <key>java.naming.provider.url</key>
                        <value>jnp://inner.liv.local:1099</value>
                     </entry>
                     <entry>
                        <key>java.naming.factory.url.pkgs</key>
                        <value>org.jboss.naming:org.jnp.interfaces"</value>
                     </entry>
                     <entry>
                        <key>jnp.timeout</key>
                        <value>5000</value>
                     </entry>
                     <entry>
                        <key>jnp.sotimeout</key>
                        <value>5000</value>
                     </entry>
                  </map>
               </constructor>
            </bean>

       

      </deployment>{code}