ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ API SupportMultiple CLNTCONN channels with the same name in a CCDT

Post new topicReply to topic
Multiple CLNTCONN channels with the same name in a CCDT View previous topic :: View next topic
Author Message
rekarm01
PostPosted: Wed Apr 03, 2019 4:42 pm Post subject: Multiple CLNTCONN channels with the same name in a CCDT Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1350

We are in the process of converting some C legacy apps to MQ clients, on Linux, using MQ v9.0.x. A client application either needs to connect to all of the queue managers in a qmgr cluster, to get messages off of a clustered input queue, or it can connect to any one of the queue managers in a qmgr cluster, to put messages on a clustered output queue.

This seems like it would be a common enough scenario, but I'm having difficulty finding documentation or examples that describe exactly what to put into the CCDT for this particular case, either here, or in the IBM Knowledge Center, or various technotes. To minimize any application code changes, we are planning to create a client channel definition table on the client host, preferably one CCDT per qmgr cluster. Each of the queue managers in the qmgr cluster currently use the same channel name for the SVRCONN channel ('APPS.SVRCONN'), so our CCDT initially looked something like:

Code:
-- for MQGET, using individual QMgr names
define CHANNEL(APPS.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('server1(port1)') QMNAME('QMGR1') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('server2(port2)') QMNAME('QMGR2') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('server3(port3)') QMNAME('QMGR3') TRPTYPE(TCP)

-- for MQPUT, using QMgr group name
define CHANNEL(APPS.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('server1(port1)') QMNAME('QMGrp1') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('server2(port2)') QMNAME('QMGrp1') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('server3(port3)') QMNAME('QMGrp1') TRPTYPE(TCP)

The problem here is that all of the CLNTCONN channels have the same name, (because all of the SVRCONN channels do), but "runmqsc -n" won't put more than one of them in a CCDT at a time, even if they connect to different queue managers. (MQ v9.1.2 introduces JSON CCDTs, that allow for multiple client channels with the same name, so there does seem to be a need for that, but it still implies that the channels need to connect to different queue managers.) We could request different SVRCONN names for the different queue managers, but that still doesn't solve the problem:

Code:
-- for MQGET, using individual QMgr names
define CHANNEL(APPS.SVRCONN.A) CHLTYPE(CLNTCONN) CONNAME('server1(port1)') QMNAME('QMGR1') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN.B) CHLTYPE(CLNTCONN) CONNAME('server2(port2)') QMNAME('QMGR2') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN.C) CHLTYPE(CLNTCONN) CONNAME('server3(port3)') QMNAME('QMGR3') TRPTYPE(TCP)

-- for MQPUT, using QMgr group name
define CHANNEL(APPS.SVRCONN.A) CHLTYPE(CLNTCONN) CONNAME('server1(port1)') QMNAME('QMGrp1') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN.B) CHLTYPE(CLNTCONN) CONNAME('server2(port2)') QMNAME('QMGrp1') TRPTYPE(TCP)
define CHANNEL(APPS.SVRCONN.C) CHLTYPE(CLNTCONN) CONNAME('server3(port3)') QMNAME('QMGrp1') TRPTYPE(TCP)

We were planning to use the same SVRCONN channel for client MQPUTs/MQGETs, but the CCDT would still have duplicate CLNTCONN channel names here, one for the MQGETs that uses the real qmgr name, and another for the MQPUTs that uses a qmgr group name.

So, what is the normal practice for this scenario? Is there a way to create a (binary) CCDT, where the SVRCONNs for different queue managers have the same channel name, or do the names really need to be unique? Is there a way to create alternate client channel definitions for the same SVRCONN channel, that use either the real queue manager name (for MQGETs), or the qmgr group name (for MQPUTs). Or is a CCDT just not going to work here, and our client applications will have to use something else, like MQCONNX with MQCNO/MQCD options?
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Apr 03, 2019 4:59 pm Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7530

Can you use a different channel name for puts and gets, and then a different pair per QM? The client app shouldn't care what channel name it ends up using when connecting.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
hughson
PostPosted: Wed Apr 03, 2019 11:44 pm Post subject: Re: Multiple CLNTCONN channels with the same name in a CCDT Reply with quote

Grand Master

Joined: 09 May 2013
Posts: 1075
Location: Bay of Plenty, New Zealand

rekarm01 wrote:
Is there a way to create a (binary) CCDT, where the SVRCONNs for different queue managers have the same channel name, or do the names really need to be unique?

If you want to use a binary CCDT (runmqsc -n) then yes, the channel names really do need to be unique. They are the key into the binary file. This restriction has been lifted in V9.1.2 if (and only if) you use a JSON format CCDT. If you REALLY must have all your SVRCONN channels named the same way then use that.

rekarm01 wrote:
Is there a way to create alternate client channel definitions for the same SVRCONN channel, that use either the real queue manager name (for MQGETs), or the qmgr group name (for MQPUTs).

Given SVRCONNs all with different names (or the same if you go the JSON route), then you certainly can use a real queue manager name and a fake queue manager name in the same CCDT. The QMNAME field in a CLNTCONN channel has only one job, and that is to allow a client application to "lookup" the CCDT entry (or entries) to be used. It doesn't have to be a real queue manager name, but it can be if you want. All you need to remember if you are using fake queue manager names is to prefix it with * on the MQCONN call.

Also, remember to set CLNTWGHT to a non-zero value to get better connection balancing, otherwise you will get an alphabetical choice (or a file order choice in the case where all channels have the same name in a JSON format CCDT).

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
rekarm01
PostPosted: Thu Apr 04, 2019 3:52 am Post subject: Re: Multiple CLNTCONN channels with the same name in a CCDT Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1350

hughson wrote:
If you want to use a binary CCDT (runmqsc -n) then yes, the channel names really do need to be unique. They are the key into the binary file. This restriction has been lifted in V9.1.2 if (and only if) you use a JSON format CCDT. If you REALLY must have all your SVRCONN channels named the same way then use that.

We're currently at v9.0.x, so JSON is not yet an option. We don't need all our SVRCONN channels to have the same name; that's just what we started with. But SVRCONN changes require internal discussions and explanations, so I'm exploring different options now, to find the best one. Upgrading to v9.1.x is a bigger discussion.

hughson wrote:
Given SVRCONNs all with different names ..., then you certainly can use a real queue manager name and a fake queue manager name in the same CCDT.

This seems similar to what PeterPotkay suggested, but I'm still a bit unclear how that would work, without also creating duplicate SVRCONN channels:

Code:
-- for MQGET, using individual QMgr names
define CHANNEL(APPS.SVRCONN.A_GET) CHLTYPE(CLNTCONN) CONNAME('server1(port1)') QMNAME('QMGR1') TRPTYPE(TCP)
...

-- for MQPUT, using QMgr group name
define CHANNEL(APPS.SVRCONN.A_PUT) CHLTYPE(CLNTCONN) CONNAME('server1(port1)') QMNAME('QMGrp1') TRPTYPE(TCP)
...

Needing to maintain two identically configured SVRCONN channels on each qmgr just to accomodate both real and fake qmgr names on the client side seems like an added risk. Is there a better option here? This is just one example; we're going to be managing many clusters, qmgrs, CCDTs, and channels.

hughson wrote:
Also, remember to set CLNTWGHT to a non-zero value to get better connection balancing, ...

I omitted some details to simplify the problem description, but thanks for that reminder.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Apr 04, 2019 11:52 pm Post subject: Re: Multiple CLNTCONN channels with the same name in a CCDT Reply with quote

Grand Master

Joined: 09 May 2013
Posts: 1075
Location: Bay of Plenty, New Zealand

rekarm01 wrote:
Needing to maintain two identically configured SVRCONN channels on each qmgr just to accomodate both real and fake qmgr names on the client side seems like an added risk. Is there a better option here?

You don't need to maintain two identically configured SVRCONN channels in order to have one real name and one fake name. You need to maintain two identically configured SVRCONN channels because you are not using the JSON format CCDT.

If you move to the JSON format CCDT then you don't have to have unique SVRCONN names - they can ALL have the same name if you want - even with different QMNAMEs.

You say you can't move up to V9.1.x yet, but please remember that it is only the clients that have to be at that level to use the JSON CCDT - the queue managers can be V8 for all that it matters

The only way to do what you want without the JSON format CCDT is to make lots of CCDTs, so that you can keep using the same channel names. I guess it depends whether that is easier than upgrading the version of the client?

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
rekarm01
PostPosted: Fri Apr 05, 2019 4:48 am Post subject: Re: Multiple CLNTCONN channels with the same name in a CCDT Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1350

hughson wrote:
You say you can't move up to V9.1.x yet, but please remember that it is only the clients that have to be at that level to use the JSON CCDT - the queue managers can be V8 for all that it matters

That hadn't occurred to me earlier, but that looks like the best option. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportMultiple CLNTCONN channels with the same name in a CCDT
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.