Izaak van Niekerk [
https://community.jboss.org/people/sakkie6yster] created the
discussion
"JBoss Messaging Bridge NOT handling Network Failure!"
To view the discussion, visit:
https://community.jboss.org/message/759863#759863
--------------------------------------------------------------
We need a JBoss JMS bridge to facilitate integration to a remote Websphere MQ connection.
Essentially we have an application running on JBoss that need to send and receive messages
to and from WMQ that is running on a remote server.
We are using JBoss 5.1.0.GA and
Websphere MQ 7.
I have setup the following three configurations (see below) in order to create the
"bridge". I am able to send a message to the local JMS queue (TestQ - source)
which is successfully picked up by the bridge service and actually sent to the target
destination (The remote MQ queue). I have tested this and everything works 100%.
Problem is, as soon as I pull out a network cable to test a typical "network
failure" the following exception is thrown (as seen on the JBoss App Console). After
plugging the network cable back in, the exception is still thrown every 5 seconds and the
message is never sent. Until I physically restart JBoss.
Exception:
+12:24:03,948 ERROR [STDERR] 2012.09.17 12:24:03 MQJMS1023E rollback failed+
+12:24:03,948 WARN [Bridge] jboss.messaging:name=TestBridge,service=Bridge Will retry
after a pause of 5000 ms+
+12:24:27,870 WARN [Bridge] jboss.messaging:name=TestBridge,service=Bridge Failed to set
up connections+
+javax.naming.NamingException: Unable to retrieve actual object from queue. The exception
was: javax.jms.JMSException: MQJMS2008: failed to open MQ queue
SYSTEM.MQCONTEXT.ADMIN.QUEUE [Root exception is javax.jms.JMSException: MQJMS2008: failed
to open MQ queue SYSTEM.MQCONTEXT.ADMIN.QUEUE]+
+ at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:902)+
+ at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:840)+
+ at javax.naming.InitialContext.lookup(InitialContext.java:396)+
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)+
+ at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)+
+ at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)+
+ at java.lang.reflect.Method.invoke(Method.java:597)+
+ at
org.jboss.naming.ExternalContext$CachedContext.invoke(ExternalContext.java:535)+
+ at $Proxy247.lookup(Unknown Source)+
+ at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:833)+
+ at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)+
+ at javax.naming.InitialContext.lookup(InitialContext.java:392)+
+ at
org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)+
+ at
org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)+
+ at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:956)+
+ at
org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1223)+
+ at org.jboss.jms.server.bridge.Bridge.access$1600(Bridge.java:68)+
+ at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1569)+
+ at java.lang.Thread.run(Thread.java:619)+
+Caused by: javax.jms.JMSException: MQJMS2008: failed to open MQ queue
SYSTEM.MQCONTEXT.ADMIN.QUEUE+
+ at
com.ibm.mq.jms.MQQueueServices.getQueueOpenException(MQQueueServices.java:406)+
+ at com.ibm.mq.jms.MQQueueServices.getQueueForBrowse(MQQueueServices.java:269)+
+ at com.ibm.mq.jms.JMSServicesMgr.getQueueForBrowse(JMSServicesMgr.java:156)+
+ at com.ibm.mq.jms.MQQueueBrowser.getEnumeration(MQQueueBrowser.java:269)+
+ at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:884)+
+ ... 18 more+
Setup:
I have the following jars in server\default\lib folder:
com.ibm.mq.commonservices.jar
com.ibm.mq.headers.jar
com.ibm.mq.jar
com.ibm.mq.jmqi.jar
com.ibm.mq.pcf-6.1.jar
com.ibm.mqetclient.jar
com.ibm.mqjms.jar
dhbcore.jar
mqcontext.jar
TestQ:
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<server>
<mbean xmbean-dd="xmdesc/Queue-xmbean.xml"
name="jboss.messaging.destination:service=Queue,name=TestIncoming"
code="org.jboss.jms.server.destination.QueueService">
<!-- Defining the DLQ for this TestQueue -->
<!-- <attribute name="DLQ">
jboss.messaging.destination:name=DLQ,service=Queue</attribute>-->
<attribute name="JNDIName">queue/TestQ</attribute>
<!-- The number of times, undilivered messages would be resend -->
<attribute name="MaxDeliveryAttempts">-1</attribute>
<depends
optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
</server>
Remote WSMQ JMS Provider:
<?xml version="1.0" encoding="UTF-8"?>
<connection-factories>
<!-- The WSMQ JMS provider loader -->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider">
<attribute name="ProviderName">RemoteJMSProvider</attribute>
<attribute
name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
<attribute name="FactoryRef">remote/edb2pre1.que.mgr</attribute>
<attribute
name="QueueFactoryRef">remote/edb2pre1.que.mgr</attribute>
<attribute
name="TopicFactoryRef">remote/edb2pre1.que.mgr</attribute>
<depends>jboss.jndi:service=ExternalContext,jndiName=remote</depends>
</mbean>
<!-- Bind a remote IBM MQ server -->
<mbean code="org.jboss.naming.ExternalContext"
name="jboss.jndi:service=ExternalContext,jndiName=remote">
<attribute name="JndiName">remote</attribute>
<attribute name="Properties">
java.naming.factory.initial=com.ibm.mq.jms.context.WMQInitialContextFactory
java.naming.provider.url=edb2pre2.momentum.co.za:1414/SYSTEM.DEF.SVRCONN
java.naming.security.authentication=none
</attribute>
<attribute
name="InitialContext">javax.naming.InitialContext</attribute>
</mbean>
Test Bridge:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.jms.server.bridge.BridgeService"
name="jboss.messaging:service=Bridge,name=TestBridge"
xmbean-dd="xmdesc/Bridge-xmbean.xml">
<depends
optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<depends
optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends>
<attribute name="SourceDestinationLookup">/queue/TestQ</attribute>
<attribute
name="TargetDestinationLookup">/remote/SS.GICSAW.FNBLIFE.REQUEST</attribute>
<attribute name="QualityOfServiceMode">0</attribute>
<attribute name="MaxBatchSize">5</attribute>
<attribute name="MaxBatchTime">1</attribute>
<attribute name="FailureRetryInterval">5000</attribute>
<attribute name="MaxRetries">-1</attribute>
<attribute name="AddMessageIDInHeader">false</attribute>
</mbean>
</server>
I am not sure if anything else is required? Like I said, I am able to send a message and
the message gets delivered as long as the network is up; i.e. I can probably assume
that my code is fine? Problem is when the network is down, the server keeps throwing the
same exception even after the network is back up again.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/759863#759863]
Start a new discussion in JBoss Messaging at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]