-
1. Re: issue with bridge while JBoss starting
timfox Jun 20, 2007 8:00 AM (in response to jasonhsu)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 Jun 20, 2007 8:02 AM (in response to jasonhsu)This is all explained in detail in the JBoss AS guide http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch2.chapter.html#ch2.servicedep.fig
-
3. Re: issue with bridge while JBoss starting
jasonhsu Jun 21, 2007 3:43 AM (in response to 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 Jun 21, 2007 3:57 AM (in response to jasonhsu)"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. -
6. Re: issue with bridge while JBoss starting
timfox Jun 29, 2007 7:51 AM (in response to jasonhsu)Is now fixed in TRUNK