Reputation: 3841
I need to hook up a Multi-instance queue manager on a Tomcat server. I have found all kinds of "properties" that I have to set to do it, but where do they go? Tomcat, in the server XML has some settings but most of the settings needed in the IBM documentation do not map. Currently we have hooked up a "single" instance queue like this:
<Resource name="jms/TelematicsQCF" CHAN="JAVA.Z1LC.CLIENT" HOST="blah.blah.com" PORT="1111" QMGR="MQB3" TRAN="1" auth="Container" description="JMS Queue Connection Factory for sending messages" factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory" type="com.ibm.mq.jms.MQQueueConnectionFactory" />
How do I hook up a multi-instance one? AND, Can I still use the Spring DefaultMessageListenerContainer
? AND (o man...) what settings do I need?
Upvotes: 1
Views: 3442
Reputation: 3841
So the answer is this:
<Resource name="jms/XXXQCF1"
CHAN="TMAX.CHANNEL"
CRSHOSTS="blah1.example.com(1420),blah2.example.com(1420)"
CROPT="67108864"
CRT="500"
QMGR="tmax.lrd.qmgr.a"
TRAN="1"
auth="Container"
description="JMS Queue Connection Factory for sending messages"
factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
type="com.ibm.mq.jms.MQQueueConnectionFactory" />
Notice that Shashi above has "CRHOSTS" and the IBM documentation has the same, however when we tried that it did not work. We put in a ticket to IBM and they said the documentation is incorrect on their website (and by the way, they wanted a ticket to fix their docs!).
I tried Shashi's "CRHOSTS" and it did not work and CRSHOSTS did work. Not sure why that is. We also had to upgrade our jars to 7.5.*. The "CROPT" and "CRT" I am not sure about but these settings work.
Upvotes: 1
Reputation: 15263
I don't have much of Tomcat knowledge but I come from WebSphere MQ background. Looking at the Context you provided, I think the below would work for Multi-instance queue manager.
I am setting CRHOSTS to multiple connection names. I am assuming, on blah.blah.com host, active instance of queue manager runs and listens at port 1414 and standby instance runs on b2.b3.com and listens at port 1544.
CROPT is reconnect option and is set to WMQ_CLIENT_RECONNECT_Q_MGR
whose value is 67108864. You can find the value of these constants from cmqc.h
file.
CRT is the reconnection timeout value which tells, for how long the client will try to reconnect. After the timeout period, client stops reconnecting if a connection attempt was not successful. In this case I have set the value to 500 seconds.
<Resource
name="jms/TelematicsQCF"
CHAN="JAVA.Z1LC.CLIENT"
CRHOSTS="blah.blah.com(1414), b2.b3.com(1544)"
CROPT="67108864"
CRT="500"
QMGR="MQB3"
TRAN="1" auth="Container"
description="JMS Queue Connection Factory for sending messages"
factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
type="com.ibm.mq.jms.MQQueueConnectionFactory"
/>
Hope this helps.
Upvotes: 1