6 Replies Latest reply on Jun 29, 2007 7:51 AM by timfox

    issue with bridge while JBoss starting

    jasonhsu

      I defined a bridge in (xxx-bridge-service.xml) to conection two queues (let's say queueA and queueB) on the same JBoss to test. I'll move the queueB to a remote JBoss. I had the error message while starting JBoss where the bridge deployed. It looks like that the queueA or even queueB hasn't been bound/created before the bridge started by JBoss. In fact, I can see the queues are created in couples of second after the bridge's error. Then I try to TOUCH the xxx-bridge-service.xml and the bridge deploy successful message shows in the console. I test a little bit by sending/ receiving the message, it works.....

      My quesiton is how to configure the the bridge been bounded not earlier than the queues be availiable.

        • 1. Re: issue with bridge while JBoss starting
          timfox

          This is not really a question specific to JBM or the bridge, it's more of a question of "How do I ensure one MBean deploys before another".

          This is done in JBoss by declaring a dependency in the MBean deployment descriptor, and is heavily used throughout JBoss.

          In the example bridge config. for example it alreasy has dependencies on the JMSProviderLoaders:

           <!-- The JMS provider loader that is used to lookup the source destination -->
           <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
          
           <!-- The JMS provider loader that is used to lookup the target destination -->
           <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
          


          So you just need to introduce dependencies on the target destinations.


          • 2. Re: issue with bridge while JBoss starting
            timfox
            • 3. Re: issue with bridge while JBoss starting
              jasonhsu

              I checked http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch2.chapter.html#ch2.servicedep.fig, however it didn't say how to do it exactly. The most confusing part is the attribute name "SourceProviderLoader" in bridge configuration file. I have no idea what attribute name I can use to set the dependancy to a destination. Finally, I found an old post in 2004. It shows the exact answer. Then I add

              <depends>jboss.messaging.destination:service=Queue,name=QueueA</depends>
              <depends>jboss.messaging.destination:service=Queue,name=QueueB</depends>
              


              It works fine now if both of the source and target destinations and the bridge are on the same JBoss. However, what I real want to know is that can one or both destinations are on the JBoss other than the bridge and how to config it?

              I've tried to add a remote JMS provider in jms-ds.xml (it works if I use a MDB to listen to a remote queue):
              <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
               name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=remote01">
              


              I'm wondering how to write the "depends" to point to a remote destination?

              • 4. Re: issue with bridge while JBoss starting
                timfox

                 

                "JasonHsu" wrote:
                The most confusing part is the attribute name "SourceProviderLoader" in bridge configuration file.


                You don't want to touch the SourceProviderLoader dependency in the bridge config. I only used that as an example of something else that uses dendendencies


                I have no idea what attribute name I can use to set the dependancy to a destination. Finally, I found an old post in 2004. It shows the exact answer. Then I add
                <depends>jboss.messaging.destination:service=Queue,name=QueueA</depends>
                <depends>jboss.messaging.destination:service=Queue,name=QueueB</depends>
                



                The thing in the depends is just the service name of the service you want to wait for.

                You can find the service names of the services by looking in the service's MBean config file (or looking at the jmx-console).

                The service name of queuB (as you discovered) is "jboss.messaging.destination:service=Queue,name=QueueB" - (look in destinations-service.xml)

                It's very simple.


                It works fine now if both of the source and target destinations and the bridge are on the same JBoss. However, what I real want to know is that can one or both destinations are on the JBoss other than the bridge and how to config it?


                AFAIK you can't do remote dependencies
                .

                Currently the bridge, once started, will retry if the connection goes down. But the connection must be up at the begining.

                I can change the code slightly so it retries at startup too.

                • 5. Re: issue with bridge while JBoss starting
                  timfox
                  • 6. Re: issue with bridge while JBoss starting
                    timfox

                    Is now fixed in TRUNK