Author |
Message
|
punky |
Posted: Wed Nov 29, 2017 6:27 pm Post subject: Connection between WAS and MQ using CCDT file |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_luke_skywalker.gif) Apprentice
Joined: 26 May 2011 Posts: 44 Location: India
|
Hello Experts,
Need your help for a question related to using CCDT file for connection between WebSphere Application Server and IBM MQ.
Platform Used: Windows Server 2012 R2
WebSphere Application Server version 9.0.0.2
IBM MQ version 9.0.1
MQHost1
Port: xxxx
Queue Manager Name: QM1
Cluster: CLUS1
Server Connection: SVRCONN1
Client Connection1: WAS.TO.MQ1(MQHost1(xxxx)); QM Name: QMGR; Affinity: Preferred; Weight:50
Client Connection2: WAS.TO.MQ2(MQHost2(yyyy)); QM Name: QMGR; Affinity: None; Weight:1
Queue: Q1; Cluster: CLUS1
MQHost2
Port: yyyy
Queue Manager: QM2
Cluster: CLUS1
Server Connection: SVRCONN2
Client Connection1: WAS.TO.MQ2(MQHost2(yyyy)); QM Name: QMGR; Affinity: Preferred; Weight:50
Client Connection2: WAS.TO.MQ1(MQHost1(xxxx)); QM Name: QMGR; Affinity: None; Weight:1
Queue: Q1; Cluster: CLUS1
WASHost1 (Standalone)
Connection Factory: MQ_CCDT
JNDI: jms/QMGR_CCDT
File location:
Queue Manager Name: *QMGR
Queue
JNDI: jms/Q1
Queue Manager Name: blank
WASHost2 (Standalone)
Connection Factory: MQ_CCDT
JNDI: jms/QMGR_CCDT
File location:
Queue Manager Name: *QMGR
Queue
JNDI: jms/Q1
Queue Manager Name: blank
Scenario:
Application which is deployed on WAS is built in spring java (and not using MBEANS) which performs function of sending and getting messages from the queue (both put and get operations).
When one of the Queue Manager QM2 goes down, connection from WAS2 swings over to MQ1 (at this moment both WAS1 and WAS2 are connected to MQ1).
But later when Queue manager QM2 is brought up, WAS1 and WAS2 still continues to listen to the queues on Queue Manager QM1.
So messages on QM2 are not consumed (The other half of design includes 2 queue managers on z/OS which are also part of same MQ cluster CLUS1. Application on mainframe side also posts messages to the Cluster Queues).
To bring back the initial state (WAS1 connected to MQ1 and WAS2 connected to MQ2), I have to restart the Application Server WAS2 (I have tried restarting application but doesn’t help for this issue).
Question: Is their any way in the setting/configurations (on MQ or WAS) that I can use so that the swing back can happen automatically when the other Queue Manager comes up?
Best Regards,
Punky |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
fjb_saper |
Posted: Thu Nov 30, 2017 6:28 am Post subject: |
|
|
![](images/avatars/gallery/misc/2.gif) Grand High Poobah
Joined: 18 Nov 2003 Posts: 20696 Location: LI,NY
|
You have a flaw in your design. WASHost1 and WASHost2 should both consume from both QM1 and QM2. This way one of the WAS goes down and no messages are left over. The same way if you bounce one of the queue managers.
However if a qmgr goes down for a time interval beyond the automatic reconnect from WAS, you will have to restart the MDB service to reconnect to the resource.
Hope this helps. ![](images/smiles/innocent.gif) _________________ MQ & Broker admin |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
punky |
Posted: Thu Nov 30, 2017 6:36 am Post subject: |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_luke_skywalker.gif) Apprentice
Joined: 26 May 2011 Posts: 44 Location: India
|
I am using CCDT files from individual Queue managers in the corresponding WAS. So each WAS is expected to connect to both MQ with a preference given to corresponding MQ (as I am using affinity)
MQHost1
Port: xxxx
Queue Manager Name: QM1
Cluster: CLUS1
Server Connection: SVRCONN1
Client Connection1: WAS.TO.MQ1(MQHost1(xxxx)); QM Name: QMGR; Affinity: Preferred; Weight:50
Client Connection2: WAS.TO.MQ2(MQHost2(yyyy)); QM Name: QMGR; Affinity: None; Weight:1
Queue: Q1; Cluster: CLUS1
MQHost2
Port: yyyy
Queue Manager: QM2
Cluster: CLUS1
Server Connection: SVRCONN2
Client Connection1: WAS.TO.MQ2(MQHost2(yyyy)); QM Name: QMGR; Affinity: Preferred; Weight:50
Client Connection2: WAS.TO.MQ1(MQHost1(xxxx)); QM Name: QMGR; Affinity: None; Weight:1
Queue: Q1; Cluster: CLUS1
Please let me know if there is some other configuration to be done to enable consuming from both Queue Managers. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
fjb_saper |
Posted: Thu Nov 30, 2017 9:37 am Post subject: |
|
|
![](images/avatars/gallery/misc/2.gif) Grand High Poobah
Joined: 18 Nov 2003 Posts: 20696 Location: LI,NY
|
punky wrote: |
I am using CCDT files from individual Queue managers in the corresponding WAS. So each WAS is expected to connect to both MQ with a preference given to corresponding MQ (as I am using affinity)
Please let me know if there is some other configuration to be done to enable consuming from both Queue Managers. |
Apparently you are not getting my meaning.
Each WAS is expected to have a connection at all times to each of the qmgrs.
Say both qmgrs are up but only one WAS is running. That instance of WAS will need to consume the queues on both QM1 and QM2.
Let's not even think here about the exception cases where one of the qmgrs or one of the WAS servers is down...
So WAS1 consumes QM1 and QM2
WAS2 consumes QM1 and QM2.
Your design has the default setup of
WAS1 consumes QM1
WAS2 consumes QM2
This is different from what I am suggesting here. ![](images/smiles/innocent.gif) _________________ MQ & Broker admin |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
punky |
Posted: Thu Nov 30, 2017 6:12 pm Post subject: |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_luke_skywalker.gif) Apprentice
Joined: 26 May 2011 Posts: 44 Location: India
|
Quote: |
Each WAS is expected to have a connection at all times to each of the qmgrs.
Say both qmgrs are up but only one WAS is running. That instance of WAS will need to consume the queues on both QM1 and QM2. |
Is it possible to do it in the current setup?
Is your suggestion to make 2 separate Connection Factory/Queue Connection factory and asking application to use the separate JNDI to make parallel connections so it can consume from queues on both Queue Managers? |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
punky |
Posted: Sun Dec 03, 2017 6:26 pm Post subject: |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_luke_skywalker.gif) Apprentice
Joined: 26 May 2011 Posts: 44 Location: India
|
Hello Guys,
Please let me know possible options on how I can make the WAS to connect to 2 Queue Managers (with different names and running on 2 separate VMs) simultaneously so that the application running can consume messages from both.
Best Regards,
Punky |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
fjb_saper |
Posted: Sun Dec 03, 2017 10:22 pm Post subject: |
|
|
![](images/avatars/gallery/misc/2.gif) Grand High Poobah
Joined: 18 Nov 2003 Posts: 20696 Location: LI,NY
|
punky wrote: |
Hello Guys,
Please let me know possible options on how I can make the WAS to connect to 2 Queue Managers (with different names and running on 2 separate VMs) simultaneously so that the application running can consume messages from both.
Best Regards,
Punky |
You need 2 connection factories defined to WAS, one for each qmgr... ![](images/smiles/innocent.gif) _________________ MQ & Broker admin |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
punky |
Posted: Sun Dec 03, 2017 10:53 pm Post subject: |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_luke_skywalker.gif) Apprentice
Joined: 26 May 2011 Posts: 44 Location: India
|
Hi fjb_saper,
Just to get a better understanding we need:
1. Two instances of the application each connection with 1 Connection Factory (defined for 1 queue manager).
2. Asking the application team to handle the connection to 2 different MQ programmatically.
Are there any other alternative which can be done at WAS/MQ administration level without changing the approach used in the application/consuming program? |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
fjb_saper |
Posted: Mon Dec 04, 2017 5:39 am Post subject: |
|
|
![](images/avatars/gallery/misc/2.gif) Grand High Poobah
Joined: 18 Nov 2003 Posts: 20696 Location: LI,NY
|
punky wrote: |
Hi fjb_saper,
Just to get a better understanding we need:
1. Two instances of the application each connection with 1 Connection Factory (defined for 1 queue manager).
2. Asking the application team to handle the connection to 2 different MQ programmatically.
Are there any other alternative which can be done at WAS/MQ administration level without changing the approach used in the application/consuming program? |
For each instance of the application (ear file) you need 2 connection factories, one to each qmgr... ![](images/smiles/innocent.gif) _________________ MQ & Broker admin |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
mq__quest |
Posted: Thu Feb 22, 2018 7:02 am Post subject: |
|
|
Apprentice
Joined: 21 Aug 2017 Posts: 48
|
fjb_saper wrote: |
You have a flaw in your design. WASHost1 and WASHost2 should both consume from both QM1 and QM2. This way one of the WAS goes down and no messages are left over. The same way if you bounce one of the queue managers.
However if a qmgr goes down for a time interval beyond the automatic reconnect from WAS, you will have to restart the MDB service to reconnect to the resource.
Hope this helps. ![](images/smiles/innocent.gif) |
Hello fjb_saper,
In scenarios like this, is it possible to have each WAS server to put to both qmgrs as well?
I mean, WAS1 puts messeges to QM1 and QM22, and WAS2 puts messages to QM1 and QM2. And same while getting the messages.
If this is possible, can it be achieved from the WAS configuration itself or is any extra coding required. Appreciate your time. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
|