1 2 Previous Next 21 Replies Latest reply on Sep 11, 2009 12:58 PM by rnicholson10

    Core Bridge - Setup Question

    rnicholson10

      I've setup a bridge and and I am sending messages to a local queue. The bridge should then deliver messages to another machine.

      I have defined the following queue in "hornetq-jms.xml":

       <queue name="phaseQueueToEngine">
       <entry name="/queue/phaseQueueToEngine"/>
       </queue>
      


      And in "hornetq-configuration.xml" I've added the following:

      In the Connectors sections a conenctor to another machine:

       <connector name="remote-engine-connector">
       <factory-class> org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
       <param key="hornetq.remoting.netty.host" value="172.16.113.22" type="String"/> <!-- jbdevapp2 -->
       <param key="hornetq.remoting.netty.port" value="5445" type="Integer"/>
       </connector>
      


      The queue (core):

       <queues>
       <queue name="jms.queue.phaseQueueToEngine">
       <address>jms.queue.phaseQueueToEngine</address>
       </queue>
       </queues>
      


      And the bridge to the other machine:

       <bridges>
       <bridge name="InputToEngineBridge">
       <queue-name>jms.queue.phaseQueueToEngine</queue-name>
       <forwarding-address>jms.queue.phaseQueueFromInput</forwarding-address>
       <!--
       <filter string="name='aardvark'"/>
       <transformer-class-name>org.hornetq.jms.example.HatColourChangeTransformer</transformer-class-name>
       -->
       <reconnect-attempts>-1</reconnect-attempts>
       <connector-ref connector-name="remote-engine-connector"/>
       </bridge>
       </bridges>
      


      All I see from the JMX console is that the local queue is being filled up with messages but nothing is ever being consumed. The default netty acceptor on the remote machine should be enough be to receive these messages. I can't see what I'm missing!

      I do not see any messages from from HQ in the log indicating that the Bridge has been set up or is working.

        • 1. Re: Core Bridge - Setup Question
          timfox

          Did you set clustered=true in the config?

          • 2. Re: Core Bridge - Setup Question
            timfox

            Probably the easiest thing to do here, is to look at the bridge example that we ship in the distro and you can see that it works.

            Now compare the config of that to your config. Take a note of the places where it differs. Probably one of those differences will explain your issue.

            • 3. Re: Core Bridge - Setup Question
              rnicholson10

              No, I didn't set clustered = true, I'm not using clustered app servers.

              Tim, I built my example from the jms bridge example shipped with HornetQ. The only difference being that mine is running across different machines.

              However, I will inspect the config files closer and see can I find another difference.

              • 4. Re: Core Bridge - Setup Question
                timfox

                I meant setting clustered to true in the hornetq config, this is nothing to do with whether your JBoss application server is clustered or not.

                Please seethe user manual core bridges chapter:

                http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/core-bridges.html

                I quote "Please also note that in order for bridges to be deployed on a server, the clustered attribute needs to be set to true in hornetq-configuration.xml."

                • 5. Re: Core Bridge - Setup Question
                  rnicholson10

                   

                  "timfox" wrote:
                  I meant setting clustered to true in the hornetq config, this is nothing to do with whether your JBoss application server is clustered or not.

                  Please seethe user manual core bridges chapter:

                  http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/core-bridges.html

                  I quote "Please also note that in order for bridges to be deployed on a server, the clustered attribute needs to be set to true in hornetq-configuration.xml."



                  Maybe it would be a good idea to amend the documentation to point out that the clustered attribute is completely unrelated to JBoss clustering. I already made this mistake, I'm sure others will too.

                  • 6. Re: Core Bridge - Setup Question
                    timfox

                    HornetQ is a completely independent messaging server and has no dependencies on anything out of JBoss Application Server.

                    The hornetq config is just that - hornetq config, it's not JBoss AS config.

                    HornetQ runs equally well standalone, and should run in any other app server too.

                    JBoss Application server has its own set of config files which control JBoss application server config.

                    But if you think it's not clear that hornetq config does not also configure parts of JBoss application server, then I can add a note in the docs ;)

                    • 7. Re: Core Bridge - Setup Question
                      rnicholson10

                      Ok, after adding the clustering attribute I now have a consumer at my first HornetQ server on the correct queue!

                      Unfortunately the bridge is not transferring any messages to the target queue. Nothing is happening. I can see there is a thousand messages on the queue and it has one consumer, but I see no log messages stating why the messages are not being sent across the core bridge?

                      Anymore golden nuggets of guidance?

                      • 8. Re: Core Bridge - Setup Question
                        timfox

                        According to the config you posted, you're forwarding messages to a remote address called "jms.queue.phaseQueueFromInput"

                        Do you have a core queue called jms.queue.phaseQueueFromInput or a JMS queue called phaseQueueFromInput on your target machine? I can't see it on the config you posted.

                        • 9. Re: Core Bridge - Setup Question
                          rnicholson10

                          Now that I can see the bridge in the JMX-Console I noticed that the connector pair contains a null:

                          remote-engine-connector
                          null
                          


                          I'm not sure why one of the connectors is null? Do I need to define the other connector somewhere?

                          I also noticed that I was unable to connect from one machine to the other on the netty port (5445). It was only listening on localhost. I added another acceptor on the target side to receive connections (Bound to actual IP Address of this machine):

                           <acceptor name="netty2">
                           <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                           <param key="hornetq.remoting.netty.host" value="172.16.113.11" type="String"/>
                           <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                           </acceptor>
                          


                          • 10. Re: Core Bridge - Setup Question
                            rnicholson10

                             

                            "timfox" wrote:
                            According to the config you posted, you're forwarding messages to a remote address called "jms.queue.phaseQueueFromInput"

                            Do you have a core queue called jms.queue.phaseQueueFromInput or a JMS queue called phaseQueueFromInput on your target machine? I can't see it on the config you posted.



                            Yes I have it defined as both a core queue and a JMS queue.

                            hornetq-jms.xml:
                             <queue name="phaseQueueFromInput">
                             <entry name="/queue/phaseQueueFromInput"/>
                             </queue>
                            


                            And in hornetq-configuration.xml:
                             <queues>
                             <queue name="jms.queue.phaseQueueFromInput">
                             <address>jms.queue.phaseQueueFromInput</address>
                             </queue>
                             </queues>
                            


                            • 11. Re: Core Bridge - Setup Question
                              rnicholson10

                               

                              "rnicholson10" wrote:
                              Now that I can see the bridge in the JMX-Console I noticed that the connector pair contains a null:

                              remote-engine-connector
                              null
                              


                              I'm not sure why one of the connectors is null? Do I need to define the other connector somewhere?


                              Just spotted that the null is because I didn't specify a backup...

                              • 12. Re: Core Bridge - Setup Question
                                rnicholson10

                                As I didn't mention it I should point out that the bridge is still not working.

                                Bummer...

                                • 13. Re: Core Bridge - Setup Question
                                  timfox

                                  Ok, so please post your *full* config, then someone can try and see what is wrong in your configuration.

                                  Like I mentioned before your best bet is to start from the working bridge example, which you know works and change it step by step until you get to your desired config.

                                  If it stops working at some point, you know that's the issue in your config.

                                  • 14. Re: Core Bridge - Setup Question
                                    rnicholson10

                                    Yes, I did as you mentioned and started with the bridge example running locally on one box. The problems I'm having is when I start to use 2 physically different machines.

                                    I have not changed any other files except those listed below in the default-with-hornetq profile created in JBoss-5.1.0.GA

                                    Here's my config:

                                    Box1

                                    hornetq-jms.xml:

                                    <configuration xmlns="urn:hornetq"
                                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                     xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
                                    
                                     <connection-factory name="ConnectionFactory">
                                     <connector-ref connector-name="netty"/>
                                     <entries>
                                     <entry name="ConnectionFactory"/>
                                     <entry name="XAConnectionFactory"/>
                                     </entries>
                                     </connection-factory>
                                    
                                     <queue name="DLQ">
                                     <entry name="/queue/DLQ"/>
                                     </queue>
                                     <queue name="ExpiryQueue">
                                     <entry name="/queue/ExpiryQueue"/>
                                     </queue>
                                    
                                     <!--
                                     PHASE Input Queues
                                     -->
                                    
                                     <queue name="phaseQueueToEngine">
                                     <entry name="/queue/phaseQueueToEngine"/>
                                     </queue>
                                    
                                    </configuration>
                                    
                                    


                                    hornetq-configuration.xml:
                                    <configuration xmlns="urn:hornetq"
                                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                     xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
                                    
                                     <bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
                                    
                                     <journal-directory>${jboss.server.data.dir}/hornetq/journal</journal-directory>
                                    
                                     <large-messages-directory>${jboss.server.data.dir}/hornetq/largemessages</large-messages-directory>
                                    
                                     <paging-directory>${jboss.server.data.dir}/hornetq/paging</paging-directory>
                                    
                                     <clustered>true</clustered>
                                    
                                     <connectors>
                                     <connector name="netty">
                                     <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="${hornetq.remoting.netty.host:localhost}" type="String"/>
                                     <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                                     </connector>
                                    
                                     <connector name="remote-engine-connector">
                                     <factory-class> org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="172.16.113.22" type="String"/> <!-- jbdevapp2 -->
                                     <param key="hornetq.remoting.netty.port" value="5445" type="Integer"/>
                                     </connector>
                                    
                                     <connector name="in-vm">
                                     <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                                     </connector>
                                    
                                     </connectors>
                                    
                                     <acceptors>
                                     <acceptor name="netty">
                                     <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="${hornetq.remoting.netty.host:localhost}" type="String"/>
                                     <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                                     </acceptor>
                                    
                                     <acceptor name="in-vm">
                                     <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
                                     <param key="hornetq.remoting.invm.serverid" value="0" type="Integer"/>
                                     </acceptor>
                                    
                                     </acceptors>
                                    
                                     <queues>
                                     <queue name="jms.queue.phaseQueueToEngine">
                                     <address>jms.queue.phaseQueueToEngine</address>
                                     </queue>
                                     </queues>
                                    
                                     <bridges>
                                     <bridge name="InputToEngineBridge">
                                     <queue-name>jms.queue.phaseQueueToEngine</queue-name>
                                     <forwarding-address>jms.queue.phaseQueueFromInput</forwarding-address>
                                     <!--
                                     <filter string="name='aardvark'"/>
                                     <transformer-class-name>org.hornetq.jms.example.HatColourChangeTransformer</transformer-class-name>
                                     -->
                                     <reconnect-attempts>-1</reconnect-attempts>
                                     <connector-ref connector-name="remote-engine-connector"/>
                                     </bridge>
                                     </bridges>
                                    
                                     <security-settings>
                                     <security-setting match="#">
                                     <permission type="createDurableQueue" roles="guest"/>
                                     <permission type="deleteDurableQueue" roles="guest"/>
                                     <permission type="createTempQueue" roles="guest"/>
                                     <permission type="deleteTempQueue" roles="guest"/>
                                     <permission type="consume" roles="guest"/>
                                     <permission type="send" roles="guest"/>
                                     </security-setting>
                                     </security-settings>
                                    
                                     <address-settings>
                                     <!--default for catch all-->
                                     <address-setting match="#">
                                     <clustered>false</clustered>
                                     <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                                     <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                                     <redelivery-delay>0</redelivery-delay>
                                     <max-size-bytes>-1</max-size-bytes>
                                     <page-size-bytes>10485760</page-size-bytes>
                                     <distribution-policy-class>org.hornetq.core.server.impl.RoundRobinDistributor</distribution-policy-class>
                                     <message-counter-history-day-limit>10</message-counter-history-day-limit>
                                     </address-setting>
                                     </address-settings>
                                    
                                    </configuration>
                                    
                                    


                                    Box2

                                    hornetq-jms.xml:
                                    <configuration xmlns="urn:hornetq"
                                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                     xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
                                    
                                     <connection-factory name="ConnectionFactory">
                                     <connector-ref connector-name="netty"/>
                                     <entries>
                                     <entry name="ConnectionFactory"/>
                                     <entry name="XAConnectionFactory"/>
                                     </entries>
                                     </connection-factory>
                                    
                                     <queue name="DLQ">
                                     <entry name="/queue/DLQ"/>
                                     </queue>
                                     <queue name="ExpiryQueue">
                                     <entry name="/queue/ExpiryQueue"/>
                                     </queue>
                                    
                                     <!--
                                     PHASE Engine Queues
                                     -->
                                    
                                     <queue name="phaseQueueFromInput">
                                     <entry name="/queue/phaseQueueFromInput"/>
                                     </queue>
                                    
                                    </configuration>
                                    
                                    


                                    hornetq-configuration.xml:
                                    <configuration xmlns="urn:hornetq"
                                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                     xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
                                    
                                     <bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
                                    
                                     <journal-directory>${jboss.server.data.dir}/hornetq/journal</journal-directory>
                                    
                                     <large-messages-directory>${jboss.server.data.dir}/hornetq/largemessages</large-messages-directory>
                                    
                                     <paging-directory>${jboss.server.data.dir}/hornetq/paging</paging-directory>
                                    
                                     <clustered>true</clustered>
                                    
                                     <connectors>
                                     <connector name="netty">
                                     <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="${hornetq.remoting.netty.host:localhost}" type="String"/>
                                     <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                                     </connector>
                                    
                                     <connector name="netty2">
                                     <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="jbdevapp2" type="String"/>
                                     <param key="hornetq.remoting.netty.port" value="5445" type="Integer"/>
                                     </connector>
                                    
                                     <connector name="in-vm">
                                     <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                                     </connector>
                                    
                                     </connectors>
                                    
                                     <acceptors>
                                     <acceptor name="netty">
                                     <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="${hornetq.remoting.netty.host:localhost}" type="String"/>
                                     <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                                     </acceptor>
                                    
                                     <!-- Create this acceptor to allow listening on the IP Address instead of just localhost -->
                                     <acceptor name="netty2">
                                     <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                                     <param key="hornetq.remoting.netty.host" value="jbdevapp2" type="String"/>
                                     <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                                     </acceptor>
                                    
                                     <acceptor name="in-vm">
                                     <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
                                     <param key="hornetq.remoting.invm.serverid" value="0" type="Integer"/>
                                     </acceptor>
                                    
                                     </acceptors>
                                    
                                     <queues>
                                     <queue name="jms.queue.phaseQueueFromInput">
                                     <address>jms.queue.phaseQueueFromInput</address>
                                     </queue>
                                     </queues>
                                    
                                     <security-settings>
                                     <security-setting match="#">
                                     <permission type="createDurableQueue" roles="guest"/>
                                     <permission type="deleteDurableQueue" roles="guest"/>
                                     <permission type="createTempQueue" roles="guest"/>
                                     <permission type="deleteTempQueue" roles="guest"/>
                                     <permission type="consume" roles="guest"/>
                                     <permission type="send" roles="guest"/>
                                     </security-setting>
                                     </security-settings>
                                    
                                     <address-settings>
                                     <!--default for catch all-->
                                     <address-setting match="#">
                                     <clustered>false</clustered>
                                     <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                                     <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                                     <redelivery-delay>0</redelivery-delay>
                                     <max-size-bytes>-1</max-size-bytes>
                                     <page-size-bytes>10485760</page-size-bytes>
                                     <distribution-policy-class>org.hornetq.core.server.impl.RoundRobinDistributor</distribution-policy-class>
                                     <message-counter-history-day-limit>10</message-counter-history-day-limit>
                                     </address-setting>
                                     </address-settings>
                                    
                                    </configuration>
                                    
                                    




                                    1 2 Previous Next