10 Replies Latest reply on Nov 17, 2011 4:35 PM by Rob Campbell

    JMS bridge not consuming messages from source

    Jukka Dahlbom Newbie

      I have set up a JMS bridge between two JBoss AS 6.1 instances,

      and the connection seems to be created without errors.

       

      However, the bridge does not consume messages from the source queue.

       

      What can cause this?

      How can I monitor the state of the bridge, to see what possible could be wrong?

       

      Here's the configuration that was appended to the default hornetq-jboss-beans.xml

         <bean name="JMSBridge" 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 (no username here) -->

                     <parameter><null /></parameter>

                     <!-- Source Password (no password here)-->

                     <parameter><null /></parameter>

                     <!-- Target User Name (no username here)-->

                     <parameter><null /></parameter>

                     <!-- Target Password (no password here)-->

                     <parameter><null /></parameter>

                     <!-- Selector -->

                     <parameter><null /></parameter>

                     <!-- Failure Retry Interval (in ms) -->

                     <parameter>5000</parameter>

                     <!-- Max Retries -->

                     <parameter>10</parameter>

                     <!-- Quality Of Service -->

                     <parameter>ONCE_AND_ONLY_ONCE</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>true</parameter>

                     <!-- register the JMS Bridge in the AS MBeanServer -->

                     <parameter>

                         <inject bean="MBeanServer"/>

                     </parameter>

                     <parameter>org.hornetq: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="sourceJNDI" />

                     </parameter>

                     <parameter>/XAConnectionFactory</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="targetJNDI" />

                     </parameter>

                     <parameter>/XAConnectionFactory</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="sourceJNDI"/>

                     </parameter>

                     <parameter>/jms/notificationRequestQueue</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="targetJNDI" />

                     </parameter>

                     <parameter>/jms/notificationRequestQueue</parameter>

                 </constructor>

             </bean>

            <bean name="sourceJNDI" 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://localhost: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="targetJNDI" 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://sd-ilmari-stgint.sanoma.fi: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>

       

      Log file showing bridge connection:

      11:10:37,436 DEBUG [org.hornetq.core.remoting.impl.netty.NettyConnector] Started Netty Connector version 3.2.3.Final-r${buildNumber}

      11:10:37,437 DEBUG [org.hornetq.core.client.impl.ClientSessionFactoryImpl] Trying to connect at the main server using connector :org-hornetq-core-remoting-impl-netty-NettyConnectorFactor

      y?port=5445&host=0-0-0-0

      11:10:37,485 DEBUG [org.hornetq.core.client.impl.ClientSessionFactoryImpl] ClientSessionFactoryImpl received backup update for live/backup pair = org-hornetq-core-remoting-impl-netty-Net

      tyConnectorFactory?port=5445&host=0-0-0-0 / null but it didn't belong to org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=0-0-0-0

      11:10:37,546 DEBUG [org.hornetq.core.client.impl.ClientSessionFactoryImpl] Trying reconnection attempt 0

      11:10:37,546 DEBUG [org.hornetq.core.remoting.impl.netty.NettyConnector] Started Netty Connector version 3.2.3.Final-r${buildNumber}

      11:10:37,546 DEBUG [org.hornetq.core.client.impl.ClientSessionFactoryImpl] Trying to connect at the main server using connector :org-hornetq-core-remoting-impl-netty-NettyConnectorFactor

      y?port=5445&host=0-0-0-0

      11:10:37,551 DEBUG [org.hornetq.core.client.impl.ClientSessionFactoryImpl] ClientSessionFactoryImpl received backup update for live/backup pair = org-hornetq-core-remoting-impl-netty-Net

      tyConnectorFactory?port=5445&host=0-0-0-0 / null but it didn't belong to org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=0-0-0-0

      11:10:37,640 INFO  [org.hornetq.jms.bridge.impl.JMSBridgeImpl] Succeeded in connecting to servers

        • 1. Re: JMS bridge not consuming messages from source
          Andy Taylor Master

          i would look at the queues to see where the messages are and what consumers they have (a bridge will be a consumer)

          • 2. Re: JMS bridge not consuming messages from source
            Jukka Dahlbom Newbie

            Via the JMX console, I get to view the entry

            module=JMS,name="notificationQueue",type=Queue

            which is the correct source queue:

             

            ConsumerCount  1

            MessageCount    1

            DeliveringCount   1

            MessagesAdded 1

             

            Invoking the listConsumersAsJSON on that queue I get

            [{"sessionID":"38a963fc-053b-11e1-8571-005056990055",

            "connectionID":"544498368",

            "creationTime":1320228770993,

            "browseOnly":false,

            "consumerID":0}]

             

            So the bridge (Should be only consumer out there) is shown as consumer,

            and the queue has receives the message from my test producer.

             

            Somehow the the messages are still not consumed and/or sent to the target queue, and I get no messages in log from

            the bridge after the server connection successful -message.

            • 3. Re: JMS bridge not consuming messages from source
              Andy Taylor Master

              according to me this looks correct, you have sent 1 message which has been consumed by the bridge.

               

              I do remember a bug on the bridge where messages weren't acked so maybe it would pay to upgrade the HornetQ version just to make sure its not that

              • 4. Re: JMS bridge not consuming messages from source
                Jukka Dahlbom Newbie

                Actually that set of values implies that the message has been added to the queue, but not consumed.

                 

                I did a local test on the target queue which has a logging consumer, and got the following values with twiddle.sh

                ( /jboss/bin/twiddle.sh get 'org.hornetq:module=JMS,type=Queue,name="notificationQueue"' )

                Selector=null

                Paused=false

                JNDIBindings=[Ljava.lang.String;@647109c4

                DeadLetterAddress=jms.queue.DLQ

                ExpiryAddress=jms.queue.ExpiryQueue

                ConsumerCount=1

                ScheduledCount=0

                Address=jms.queue.notificationQueue

                Name=notificationQueue

                Temporary=false

                MessageCount=0

                DeliveringCount=0

                MessagesAdded=1

                 

                The way I understand that, is that a message had been added, and since it was already consumed,

                the messagecount was 0.

                 

                Running the same on the source queue, which has bridge as consumer:

                Selector=null

                Paused=false

                JNDIBindings=[Ljava.lang.String;@647109c4

                DeadLetterAddress=jms.queue.DLQ

                ExpiryAddress=jms.queue.ExpiryQueue

                ConsumerCount=1

                ScheduledCount=0

                Address=jms.queue.notificationQueue

                Name=notificationQueue

                Temporary=false

                MessageCount=1

                DeliveringCount=1

                MessagesAdded=1

                 

                MessageCount is still 1, implying that the message was not yet consumed.

                • 5. Re: JMS bridge not consuming messages from source
                  Jukka Dahlbom Newbie

                  Looks like the bridge does, indeed, consume the message. However, it seems to feed it right

                  back into the same queue it consumes it from. Then it consumes it again, and again...

                   

                  I switched the logging level for hornetq to TRACE and stopped + restarted the bridge, and got

                  the following monster in the log:

                   

                  2011-11-02 17:24:33,157 TRACE [org.hornetq.core.server.impl.ServerConsumerImpl] (Old I/O server worker (parentId: 33195484

                  3, channelId: 1517820871, null => /0.0.0.0:5445)) Received 653672 credits, previous value = -41952 currentValue = 611720

                  2011-11-02 17:24:33,159 TRACE [org.hornetq.core.client.impl.ClientConsumerImpl] (pool-12-thread-1) Returning ClientMessage

                  [messageID=81944, durable=true, address=jms.queue.notificationQueue,properties=TypedProperties[{JMSXDeliveryCount=1, HQ_BR

                  IDGE_MSG_ID_LIST=ID:5a93304a-0555-11e1-8465-005056990055,ID:c4055c4f-0555-11e1-8465-005056990055,ID:c426c704-0555-11e1-846

                  5-005056990055,ID:c4378fe9-0555-11e1-8465-005056990055,ID:c4559f3e-0555-11e1-8465-005056990055,ID:c466b643-0555-11e1-8465-

                  005056990055,ID:c475f888-0555-11e1-8465-005056990055,ID:c48b072d-0555-11e1-8465-005056990055,ID:c49cb972-0555-11e1-8465-00

                  5056990055,ID:c4af7e27-0555-11e1-8465-005056990055,ID:c4c06e1c-0555-11e1-8465-005056990055,ID:c4d09ac1-0555-11e1-8465-0050

                  56990055,ID:c4def2a6-0555-11e1-8465-005056990055,ID:c4f030bb-0555-11e1-8465-005056990055,ID:c502a750-0555-11e1-8465-005056

                  990055,ID:c5137035-0555-11e1-8465-005056990055,ID:c528ccfa-0555-11e1-8465-005056990055,ID:c53b1c7f-0555-11e1-8465-00505699

                  0055,ID:c54b2214-0555-11e1-8465-005056990055,ID:c55ad989-0555-11e1-8465-005056990055,ID:c569cdae-0555-11e1-8465-0050569900

                  55,ID:c579fa53-0555-11e1-8465-005056990055,ID:c58a4e08-0555-11e1-8465-005056990055,ID:c598ccfd-0555-11e1-8465-005056990055

                  ,ID:c5a724e2-0555-11e1-8465-005056990055,ID:c5bef2a7-0555-11e1-8465-005056990055,ID:c5cef83c-0555-11e1-8465-005056990055,I

                  D:c5ddc551-0555-11e1-8465-005056990055,ID:c5eda3d6-0555-11e1-8465-005056990055,ID:c5fd825b-0555-11e1-8465-005056990055,ID:

                  c6174bf0-0555-11e1-8465-005056990055,ID:c64b7b55-0555-11e1-8465-005056990055,ID:c6a1638a-0555-11e1-8465-005056990055,ID:c4

                  671117-0565-11e1-a94f-005056990055,ID:c47ededc-0565-11e1-a94f-005056990055,ID:c4991da1-0565-11e1-a94f-005056990055,ID:c4a9

                  e686-0565-11e1-a94f-005056990055,ID:c4bbc0db-0565-11e1-a94f-005056990055,ID:c4cb7750-0565-11e1-a94f-005056990055,ID:c4dbf2

                  15-0565-11e1-a94f-005056990055,ID:c4eb827a-0565-11e1-a94f-005056990055,ID:c4fb880f-0565-11e1-a94f-005056990055,ID:c50b1874

                  -0565-11e1-a94f-005056990055,ID:c51b9339-0565-11e1-a94f-005056990055,ID:c52bbfde-0565-11e1-a94f-005056990055,ID:c53d9a33-0

                  565-11e1-a94f-005056990055,ID:c54e8a28-0565-11e1-a94f-005056990055,ID:c55fc83d-0565-11e1-a94f-005056990055,ID:c570b832-056

                  5-11e1-a94f-005056990055,ID:c58096b7-0565-11e1-a94f-005056990055,ID:c591117c-0565-11e1-a94f-005056990055,ID:c5a053c1-0565-

                  11e1-a94f-005056990055,ID:c5b05956-0565-11e1-a94f-005056990055,ID:c5c4568b-0565-11e1-a94f-005056990055,ID:c5ecc620-0565-11

                  e1-a94f-005056990055,ID:c5fe7965-0565-11e1-a94f-005056990055,ID:c60fde8a-0565-11e1-a94f-005056990055,ID:c620594f-0565-11e1

                  -a94f-005056990055,ID:c630ad04-0565-11e1-a94f-005056990055,ID:c64100b9-0565-11e1-a94f-005056990055,ID:c65042fe-0565-11e1-a

                  94f-005056990055,ID:c6618113-0565-11e1-a94f-005056990055,ID:c670c358-0565-11e1-a94f-005056990055,ID:c682c4bd-0565-11e1-a94

                  f-005056990055,ID:c69402d2-0565-11e1-a94f-005056990055,ID:c6a34517-0565-11e1-a94f-005056990055,ID:c6b175ec-0565-11e1-a94f-

                  005056990055,ID:c6c265e1-0565-11e1-a94f-005056990055,ID:c6de7966-0565-11e1-a94f-005056990055,ID:c6ef424b-0565-11e1-a94f-00

                  5056990055,ID:c6ffe420-0565-11e1-a94f-005056990055,ID:c71085f5-0565-11e1-a94f-005056990055,ID:c7240dfa-0565-11e1-a94f-0050

                  56990055,ID:c73524ff-0565-11e1-a94f-005056990055,ID:c74a33a4-0565-11e1-a94f-005056990055,ID:c75c0df9-0565-11e1-a94f-005056

                  990055,ID:c76b774e-0565-11e1-a94f-005056990055,ID:c77a9283-0565-11e1-a94f-005056990055,ID:c78a49f8-0565-11e1-a94f-00505699

                  0055,ID:c7a43a9d-0565-11e1-a94f-005056990055,ID:c7b578b2-0565-11e1-a94f-005056990055,ID:c7c668a7-0565-11e1-a94f-0050569900

                  55,ID:c7d77fac-0565-11e1-a94f-005056990055,ID:c7e7ac51-0565-11e1-a94f-005056990055,ID:c7f87536-0565-11e1-a94f-005056990055

                  ,ID:c807906b-0565-11e1-a94f-005056990055,ID:c818f590-0565-11e1-a94f-005056990055,ID:c82810c5-0565-11e1-a94f-005056990055,I

                  D:c83a122a-0565-11e1-a94f-005056990055,ID:c84a3ecf-0565-11e1-a94f-005056990055,ID:c8598014-0565-11e1-a94f-005056990055,ID:

                  c8691079-0565-11e1-a94f-005056990055,ID:c879160e-0565-11e1-a94f-005056990055,ID:c88ac953-0565-11e1-a94f-005056990055,ID:c8

                  99e488-0565-11e1-a94f-005056990055,ID:c8a88a8d-0565-11e1-a94f-005056990055,ID:c8b757a2-0565-11e1-a94f-005056990055,ID:c8cf

                  c1a7-0565-11e1-a94f-005056990055,ID:c8e08a8c-0565-11e1-a94f-005056990055,ID:c90b4411-0565-11e1-a94f-005056990055,ID:c91cd0

                  46-0565-11e1-a94f-005056990055,ID:c92c60ab-0565-11e1-a94f-005056990055,ID:c93d77b0-0565-11e1-a94f-005056990055,ID: ...

                  • 6. Re: JMS bridge not consuming messages from source
                    Jukka Dahlbom Newbie

                    While hunting for the solution, I noticed that I'm still not getting everything logged at trace level.

                     

                    For example this one in (2.2.5_AS7, org.hornetq.jms.bridge.impl.JMSBridgeImpl on lines 1842-1875):

                    public void run()

                          {

                             if (JMSBridgeImpl.trace)

                             {

                                JMSBridgeImpl.log.trace("Failure handler running");

                             }

                     

                             // Clear the messages

                             messages.clear();

                     

                             cleanup();

                     

                             boolean ok = false;

                     

                             if (maxRetries > 0 || maxRetries == -1)

                             {

                                JMSBridgeImpl.log.warn("Will retry after a pause of " + failureRetryInterval + " ms");

                     

                                pause(failureRetryInterval);

                     

                                // Now we try

                                ok = setupJMSObjectsWithRetry();

                             }

                     

                             if (!ok)

                             {

                                failed();

                             }

                             else

                             {

                                succeeded();

                             }

                          }

                       }

                     

                    I get the INFO messages from succeeded(), but not the trace messages from when the run() is called.

                     

                    Any ideas how to turn on the TRACE level for the bridge classes as well?

                    They should be using the same logger facility as everything else, but my settings

                    for hornetq level don't seem to affect them correctly.

                    • 7. Re: JMS bridge not consuming messages from source
                      Jukka Dahlbom Newbie

                      Saga continues:

                       

                      I verified that the network connection between these servers is formed.

                      Since the bridge is running on the source side, I stopped the bridge,

                      ran netstat -c -n on the target side and restarted the bridge.

                       

                      There was connections to the following ports on the target server:

                      1098 (JNDI?)

                      1099 (JNDI)

                      5445 (netty).

                       

                      I'm still at a loss as to how to diagnose this issue further: What class is

                      responsible for delivering the message to the target queue? Is there trace logging available?

                       

                      Any help is very much appreciated.

                      • 8. Re: JMS bridge not consuming messages from source
                        Jukka Dahlbom Newbie

                        After clearing out some of the commented sections of the configuration files, and separating

                        the target server side acceptors into local and external connections, something happened to the bridge.

                         

                        Now, the bridge still does not transfer the messages after restarting the servers.

                        However, if I stop and start the bridge again, the messages start getting transfered.

                         

                        I can't claim to know what caused this change, nor why it requires a bridge restart for it to start working,

                        but at least this is some progress.

                        • 9. Re: JMS bridge not consuming messages from source
                          Rob Campbell Newbie

                          I'm seeing the same thing in a slightly different setup. I've got 2 machines, call them hornetqserver and activemqserver. In a JBoss 6.1 AS on hornetqserver, I've got a HornetQ JMS bridge connecting the local targetTopic to an ActiveMQ sourceTopic on activemqserver. Startup logs no errors, but I don't get any messages on the targetTopic. ActiveMQ lists a subscriber (the bridge). Wireshark shows messages coming through to the hornetqserver, but they aren't listed as dequeued on the ActiveMQ side and they don't show up on the JMX console message count on the HornetQ targetTopic.

                           

                          Then I make a cosmetic (whitespace) change to hornetq-jboss-beans.xml and resave, the JMS bridge redeploys and messages pass successfully. Here are my additions to hornetq-jboss-beans.xml:

                           

                          {code:xml}

                             <!-- The sourceTopic (activemq) to targetTopic (hornetq) Bridge -->

                             <bean name="JMSBridge" class="org.hornetq.jms.bridge.impl.JMSBridgeImpl">

                                     <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 username (no username here) -->

                                         <parameter><null /></parameter>

                                         <!-- Source password (no password here)-->

                                         <parameter><null /></parameter>

                                         <!-- Target username (no username here)-->

                                         <parameter><null /></parameter>

                                         <!-- Target password (no password here)-->

                                         <parameter><null /></parameter>

                                         <!-- Selector -->

                                         <parameter><null /></parameter>

                                         <!-- Interval to retry in case of failure (in ms) -->

                                         <parameter>5000</parameter>

                                         <!-- Maximum number of retries to connect to the source and target -->

                                         <parameter>-1</parameter>

                                         <!-- Quality of service -->

                                         <parameter>AT_MOST_ONCE</parameter>

                                         <!-- Maximum batch size -->

                                         <parameter>1</parameter>

                                         <!-- Maximum 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>

                                         <!-- concatenate JMS messageID to the target's message header -->

                                         <parameter>true</parameter>

                                         <!-- register the JMS Bridge in the JMX MBeanServer -->

                                         <parameter>

                                             <inject bean="MBeanServer"/>

                                         </parameter>

                                         <parameter>org.hornetq:service=JMSBridge</parameter>

                                     </constructor>

                                     <property name="transactionManager">

                                         <inject bean="RealTransactionManager"/>

                                     </property>

                                    

                                     <!-- HornetQ JMS Server must be started before the bridge -->

                                     <depends>JMSServerManager</depends>

                                    

                                 </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="ActiveMQJNDI" />

                                         </parameter>

                                         <parameter>TopicConnectionFactory</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="HornetQJNDI" />

                                         </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="ActiveMQJNDI" />

                                         </parameter>

                                         <parameter>sourceTopic</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="HornetQJNDI" />

                                         </parameter>

                                         <parameter>targetTopic</parameter>

                                     </constructor> 

                                 </bean>

                                

                                 <!-- JNDI is a Hashtable containing the JNDI properties required -->

                                 <!-- to connect to the *source* JMS resources                    -->      

                                <bean name="ActiveMQJNDI" 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.apache.activemq.jndi.ActiveMQInitialContextFactory</value>

                                         </entry>

                                         <entry>

                                            <key>java.naming.provider.url</key>

                                            <!-- **************************************** -->

                                            <!-- Replace with the *source* server address -->

                                            <!-- **************************************** -->

                                            <value>tcp://activemqserver:61616</value>

                                         </entry>

                                         <entry>

                                            <key>java.naming.factory.url.pkgs</key>

                                            <value>org.jboss.naming:org.jnp.interfaces</value>

                                         </entry>

                                         <entry>

                                            <key>topic.sourceTopic</key>

                                            <value>sourceTopic</value>

                                         </entry>

                                         <entry>

                                            <key>connectionFactoryNames</key>

                                            <value>TopicConnectionFactory</value>

                                         </entry>

                                         <entry>

                                            <key>jnp.timeout</key>

                                            <value>5000</value>

                                         </entry>

                                         <entry>

                                            <key>jnp.sotimeout</key>

                                            <value>5000</value>

                                         </entry>

                                      </map>

                                   </constructor>

                                </bean>

                               

                                <!-- JNDI is a Hashtable containing the JNDI properties required -->

                                <!-- to connect to the *target* JMS resources                    -->      

                                <bean name="HornetQJNDI" 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>

                                            <!-- **************************************** -->

                                            <!-- Replace with the *target* server address -->

                                            <!-- **************************************** -->

                                            <value>jnp://hornetqserver: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>

                          {code}

                          • 10. Re: JMS bridge not consuming messages from source
                            Rob Campbell Newbie

                            Jukka-   Do you have a bridge connection failure at startup, but then the retry succeeds? I think that's the source of my problem, as described here: https://issues.jboss.org/browse/HORNETQ-496