Hi all, I'm pretty new to JMS so please bare with me, I'm trying to learn it as fast as I can. Any help is greatly appreciated.
At my work I need to implement a broadcast system for some entities that we have. We were working with Jboss6 but due to some issues we were forced to migrate to Jboss 7 (precisely 7.1.1), but bridges are not supported in this version, so looking around with google found that they recommend to get the bridge up and running manualy using JMSBridgeImpl.
I made a simple app to learn how this works, its designed in a star configuration where:
the central server has an inputQueue where it receibes messages. Through divert it replicates the messages in N outputQueues (one for each client application). I've created a bean that starts at startup and creates the N JMSBridges (it takes the configuration from an XML file). I managed to make the connections with the bridges and messages are being sent, but, there are a couple of issues:
1) The messages are only sent to the clients IF the clients were up and running (in remote servers) before the central application (the one that receives and diverts the messages to the outputQueues) gets started.
2) If we first get running the central application, the bridges start trying to connect to the clients with no success (due to them being down), we then start the clients and the bridges manage to connect, but the messages are not being delivered to the clients.
3) If all is working OK and we stop one of the clients, the corresponding bridge loses the connection and starts to retry connecting, if then we get the client running, the bridge keeps tryng to connect to no avail, even though it had made a successful connection a couple of minutes earlier. The Exception being thrown again and again is:
17:47:48,564 INFO [org.hornetq.jms.bridge.impl.JMSBridgeImpl] (pool-9-thread-2) Failed to set up JMS bridge connections. Most probably the source or target servers are unavailable. Will retry after a pause of 3000 ms
17:47:51,566 WARN [org.hornetq.jms.bridge.impl.JMSBridgeImpl] (pool-9-thread-2) Failed to connect bridge: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "org.hornetq:main" from local module loader @2acdb06e (roots: /opt/jboss-as-7.1.1.Final-SINCRO/modules)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:664) [rt.jar:1.6.0_30]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) [rt.jar:1.6.0_30]
at javax.naming.InitialContext.init(InitialContext.java:223) [rt.jar:1.6.0_30]
at javax.naming.InitialContext.<init>(InitialContext.java:197) [rt.jar:1.6.0_30]
at org.hornetq.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:55) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:40) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1083) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjectsWithRetry(JMSBridgeImpl.java:1341) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.access$2100(JMSBridgeImpl.java:71) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.bridge.impl.JMSBridgeImpl$FailureHandler.run(JMSBridgeImpl.java:1864) [hornetq-jms-2.2.13.Final.jar:]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
can someone give me a hand with this?
greatly appreciated for any help