1 2 Previous Next 25 Replies Latest reply on Dec 16, 2013 11:39 AM by jbertram

    bridge not working, why?

    ohmygod

      I am creating a new thread to track the bridge problem. The original thread is this one:https://community.jboss.org/message/849173

       

      I have tested several settings for the divert and bridge configuration and confirmed the divert is working fine, but the bridge seems not able to foward request from server1 to server2.

       

      I found the divert settins could work well on server1. Below is the setting.

      <diverts>
           <divert name="test-divert">
                              <address>jms.queue.queue/com.demo.testQueue</address>
                              <forwarding-address>jms.queue.queue/com.demo.testQueue1</forwarding-address>
                              <exclusive>true</exclusive>
           </divert></diverts>
      

       

      Then I tried adding bridge settings to expect forwarding request testQueue1 to testQueue2 on server2. Below is the setting

      <bridges>
           <bridge name="test-bridge">
                              <queue-name>jms.queue.queue/com.demo.testQueue1</queue-name>
                              <forwarding-address>jms.queue.queue/com.demo.testQueue2</forwarding-address>
                              <retry-interval>1000</retry-interval>
                              <retry-interval-multiplier>1.0</retry-interval-multiplier>
                              <reconnect-attempts>-1</reconnect-attempts>
                              <use-duplicate-detection>true</use-duplicate-detection>
                              <confirmation-window-size>10000000</confirmation-window-size>
                              <static-connectors>
                                  <connector-ref>remote-connector</connector-ref>
                              </static-connectors>
            </bridge>
      </bridges>
      

       

      But it does not work. I found testQueue1 is still consumed on server1 by testQueue1. I can not find what the problem is. Can someone help me?

       

      I have added the "remote-connector" on server1:

      <connectors>
                          <netty-connector name="netty" socket-binding="messaging"/>
                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                          </netty-connector>
                          <in-vm-connector name="in-vm" server-id="0"/>
                          <connector name="remote-connector">
                              <factory-class>
                                  org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
                              </factory-class>
                              <param key="host" value="localhost"/>
                              <param key="port" value="5446"/>
                          </connector>
      </connectors>
      

       

      and "remote-connector' acceptor on server2:

      <acceptors>
                          <netty-acceptor name="netty" socket-binding="messaging"/>
                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                              <param key="direct-deliver" value="false"/>
                          </netty-acceptor>
                          <in-vm-acceptor name="in-vm" server-id="0"/>
                          <acceptor name="remote-connector">
                              <factory-class>
                                  org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory
                              </factory-class>
                              <param key="host" value="localhost"/>
                              <param key="port" value="5446"/>
                          </acceptor>
      </acceptors>
      

      BTW, server1 and server2 are running on my same machine.

       

      testQueue2 on server2:

      <jms-queue name="queue/com.demo.testQueue2">
           <entry name="queue/com.demo.testQueue2"/>
      </jms-queue>
      
        • 1. Re: bridge not working, why?
          ataylor

          a couple of things to check:

           

          1. the message/delivery counts on the queue, this will tell you the path of a message, you can do this via jconsole.

          2. the bridge is connected properly, it should appear as a consumer on queue1

          3. check server2 has a connection for the bridge, i.e. again in jconsole

          • 2. Re: bridge not working, why?
            ohmygod

            Thanks, Andy. Can you please share me a little more about how to check with jconsole? I am using windows OS. When I run jconsole.bat, I just see the memory/thread/class related information in the UI. How to check the three things you mentioned? Are some commands needed for this? I am really not using jconsole as a tool much during my normal work... Appreciated in advance.

            • 3. Re: bridge not working, why?
              ataylor

              log into jconsole, choose the process to connect to, click on mbeans and you will see queue mbeans. just inspect those

              • 4. Re: bridge not working, why?
                ohmygod

                1.jpg

                 

                I checked the list under MBean, but did not see any information. Which item should the queue beans be located at?

                • 5. Re: Re: bridge not working, why?
                  ohmygod

                  2.jpg

                   

                  I found the bridge undre jboss.as/messaging, and saw the "started" status is "notavailable" in red(sorry, this is Chinese system). Anything else important needed to check to locate the cause?

                  • 6. Re: Re: bridge not working, why?
                    ataylor

                    it probably means it cant connect for some reason, wrong host/port, security issue, its hard to say, check the logs to see if there are any messages.

                    • 7. Re: Re: bridge not working, why?
                      ohmygod

                      There is no log under standalone/log folder. And I do not see any warn or error message in my application log. Server1 just proceeds with the jms request which is supposed to transfer to server2.

                       

                      Can you see any wrong places or missing settings in my configuration? I really have no idea on where to look at. It just works fine as there is no any bridge configuration..

                       

                      BTW, why are there always two same items for each queue?

                      3.jpg

                      • 8. Re: Re: bridge not working, why?
                        ataylor

                        you could debug it or alternatively if you could provide me with an example i can take a look, you could base it on one of the cluster examples as they start multiple servers.

                        • 9. Re: Re: bridge not working, why?
                          ohmygod

                          em, it should not be easy to provide you my example becaue I am running the jms queues in my project which contains a lot of queues together.

                           

                          Can you show me how to debug this stuff? Or can you help double check with my configurations I pasted above and see if there is any mistake there?

                          • 10. Re: Re: bridge not working, why?
                            ataylor

                            at first glance your configs look fine, you can find the source at github and just debug bridgeimpl. the examples re very easy to write, just copy one and replace the config with yours.

                            • 11. Re: Re: bridge not working, why?
                              ohmygod

                              As I just asked, is this strange or normal? why are there two same items for each queue? (anyway, it is strange to me)

                              3.jpg

                              • 12. Re: Re: bridge not working, why?
                                ataylor

                                yes that is strange, maybe you created one with a hidden character, i would clear down your journals

                                • 13. Re: Re: Re: bridge not working, why?
                                  ohmygod

                                  The problem is there are also two items for system's testQueue which is not defined by my project.

                                  4.jpg

                                   

                                  <jms-queue name="testQueue">
                                        <entry name="queue/test"/>
                                        <entry name="java:jboss/exported/jms/queue/test"/>
                                  </jms-queue>
                                  <jms-topic name="testTopic">
                                        <entry name="topic/test"/>
                                        <entry name="java:jboss/exported/jms/topic/test"/>
                                  </jms-topic>
                                  
                                  • 14. Re: Re: Re: bridge not working, why?
                                    ataylor

                                    once a destination is created and is durable it never gets deleted even if you change your config. I would clear your journals

                                    1 2 Previous Next