Author |
Message
|
morfius9 |
Posted: Tue May 29, 2007 12:20 am Post subject: Does a CICS program have to connect to the queue managers? |
|
|
Novice
Joined: 06 May 2007 Posts: 13
|
Hi,
Does a CICS program have to connect to the corresponding queue manager before issuing calls? I read somewhere that MQ Connect doesnt need to be performed in CICS. If this is the case, then how does the connection get setup. Can someone clarify this for me? |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 12:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
From the MQCONN entry of the Application Programming Reference:
Quote: |
On z/OS, the queue managers to which it is possible to connect are determined by the environment:
For CICS, you can use only the queue manager to which the CICS system is connected. The QMgrName parameter must still be specified, but its value is ignored; blanks are recommended. |
_________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue May 29, 2007 12:30 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
And from the description of the other MQ API calls:
Quote: |
Hconn (MQHCONN) - input
Connection handle.
This handle represents the connection to the queue manager. The value of Hconn was returned by a previous MQCONN or MQCONNX call.
On z/OS for CICS applications, and on OS/400 for applications running in compatibility mode, the MQCONN call can be omitted, and the following value specified for Hconn:
MQHC_DEF_HCONN
Default connection handle.
|
_________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
morfius9 |
Posted: Tue May 29, 2007 12:32 am Post subject: |
|
|
Novice
Joined: 06 May 2007 Posts: 13
|
Vitor, i do agree that the program can connect to only the queue managers configured for that CICS region. But we do have an MQ program that is called to perform OPEN/PUT/PUT1/CLOSE commands. This program doesnt connect to the queue manager. I was curious about how this program would connect to the corresponding queue manager for a queue and if the connection dropped, how it would recognise the same.
Thanks,
morf |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 12:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
morfius9 wrote: |
Vitor, i do agree that the program can connect to only the queue managers configured for that CICS region. |
I was unaware you could connect more than 1 queue manager to a CICS region....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
morfius9 |
Posted: Tue May 29, 2007 1:25 am Post subject: |
|
|
Novice
Joined: 06 May 2007 Posts: 13
|
No. we have a cluster of queue managers here, |
|
Back to top |
|
 |
morfius9 |
Posted: Tue May 29, 2007 1:35 am Post subject: |
|
|
Novice
Joined: 06 May 2007 Posts: 13
|
bOB,
My program is not detecting the condition when a queue manager goes down and then comes back up coz this is a different instance that comes up and the program returns code 2203. So in this case should the program be restarted or the connection handle be reset or something so that we can detect the new queue manager that has been started.
Thanks, morf |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 1:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
morfius9 wrote: |
No. we have a cluster of queue managers here, |
There's a difference between a cluster of queue managers and multiple CICS connections. Your application still only connects to a single queue manager, even if that queue manager participates in a cluster.
I'm not saying you can't associate more than one queue manager with a CICS system, simply that I thought it was a one-to-one mappping, hence the lack of ability to pick one. I could be wrong, and look to people with more CICS knowledge to comment. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue May 29, 2007 1:38 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
Your CICS region is connected to a specific queue manager specified in the CICS system initialization parameters or via the CKQC transaction.
The CICS region and CICS transcations cannot connect to an arbitrary member of a cluster or a queue sharing group. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 1:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
morfius9 wrote: |
My program is not detecting the condition when a queue manager goes down and then comes back up coz this is a different instance that comes up and the program returns code 2203. |
Sounds like you don't have fail on quiecsing set. You application should terminate when it detects that the queue manager is trying to come down. It should certainly terminates (with an embarassed shrug) if it gets a 2203. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue May 29, 2007 1:47 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
The MQ CICS adapter automatically monitors the connection between CICS and MQ and restarts it when needed.
If a CICS transaction receives a reason code that indicates the connection is broken (e.g. MQRC_CONNECTION_BROKEN) or is about to go (e.g. MQRC_Q_QMGR_QUIESCING) it should terminate and then use triggering to restart the application when the connection is restored. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 1:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bob_buxton wrote: |
Your CICS region is connected to a specific queue manager specified in the CICS system initialization parameters or via the CKQC transaction.
The CICS region and CICS transcations cannot connect to an arbitrary member of a cluster or a queue sharing group. |
Thanks!
(It's been a while, and I went from "CICS connection is absolutely fixed, absolutely certainly" to "Erm....." in about 2 minutes... ) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
morfius9 |
Posted: Tue May 29, 2007 2:16 am Post subject: |
|
|
Novice
Joined: 06 May 2007 Posts: 13
|
So if the program restarts, will it be able to break out of the connection to the old queue manager and be afresh and set to check the status of the messages sent to the new instance of the queue manager when it comes up? And what if the queue manager is not up when the program restarts itself and tries to put another message?
-MorF |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 2:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
morfius9 wrote: |
So if the program restarts, will it be able to break out of the connection to the old queue manager |
It will be unable to see the old, out of scope, connection because this will be the new, triggered (or otherwise restarted) instance of the program.
morfius9 wrote: |
And what if the queue manager is not up when the program restarts itself and tries to put another message?
|
Then your application should detect the reason code and respond appropriately, like it should to the 2203. _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Tue May 29, 2007 2:31 am; edited 1 time in total |
|
Back to top |
|
 |
morfius9 |
Posted: Tue May 29, 2007 2:29 am Post subject: |
|
|
Novice
Joined: 06 May 2007 Posts: 13
|
You guys have been awesome...Thanks a lot.. Ill use this feedback to modify the existing design... |
|
Back to top |
|
 |
|