Author |
Message
|
sebastia |
Posted: Sat Nov 12, 2005 1:46 am Post subject: can MQ Client write in to a cluster queue ? |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
.
We have 2 que mgrs (called QM1 and QM2) in a cluster,
and each shares a queue (called Q1) in to the cluster.
.
Another que mgr, called QM3 is also in the cluster.
.
If my application connects to QM3, and write into Q1,
the messages get split between QM1 and QM2.
So far so, good.
.
Now I want to do the same using the CLIENT libraries
I do not find any word saying "it is not posssible" in the manuals,
but it does not work when I try it.
The Ret Code says "no such local que" ...
.
Can somebody provide me some pointer to a manual
where it says "clear and loud" .. "you Can dot it" or "you can NOT do it" ???
.
Thanks a lot.
.
(dedicated to Alper/Tu)
. |
|
Back to top |
|
 |
bower5932 |
Posted: Sat Nov 12, 2005 2:40 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You should see no difference between using a client to connect to the queue manager or bindings when writing to a cluster queue. Can you post the exact return code that you are getting? |
|
Back to top |
|
 |
hopsala |
Posted: Sat Nov 12, 2005 6:08 am Post subject: |
|
|
 Guardian
Joined: 24 Sep 2004 Posts: 960
|
As bower said, there is no reason why you should be able to do this; in fact, there is no difference between using client or server concerning Any WMQ functionality, the same code (except in very specific cases, which I shall not elaborate upon here) will always work regardless of binding type.
My guess is that you filled out RemoteQmgrName, instead of leaving it empty, but it's hard to tell with so little info - post relevant code snippet and return code and we'll have a look. |
|
Back to top |
|
 |
alperb |
Posted: Wed Nov 16, 2005 5:59 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 25
|
The code that does not connect to cluster manager but connects to an ordinary mq manager as client is as follows. We are using "imqb23vn.lib",
"imqc23vn.lib". As the configuration we have two managers on windows and one on os/390. We are trying to connect to the one hosted on windows 2003. Channelname is a server connection channel in the cluster, commtype is TCP, connection name is the IP of manager with the port assigned to cluster ,the queue manager name is empty and the queue name is cluster's shared queue. The reason code returning in an attempt to connect is 2085 ("MQRC_UNKNOWN_OBJECT_NAME"). However when "imqb23vn.lib" and "imqs23vn.lib" are used and connected as server everything is fine.
Code: |
MQBirth(char *pi_channelname, char *pi_commtype,char *pi_connname, char * pi_qmngr_name, char * pi_q_name, bool isForPut)
{
channel.setHeartBeatInterval( 1 );
channel.setChannelName(pi_channelname);
if ( 0==strcmp(pi_commtype,"LU62") )
{
channel.setTransportType( MQXPT_LU62 );
}
if ( 0==strcmp(pi_commtype,"NETBIOS" ))
{
channel.setTransportType( MQXPT_NETBIOS );
}
if ( 0==strcmp(pi_commtype,"SPX"))
{
channel.setTransportType( MQXPT_SPX );
}
if ( 0==strcmp(pi_commtype,"TCP" ))
{
channel.setTransportType( MQXPT_TCP );
}
channel.setConnectionName(pi_connname);
qmgr.setChannelReference(channel);
qmgr.setName(pi_qmngr_name);
if ( !qmgr.connect( ) )
{
GetLastInfo("ImqQueueManager::connect failed with reason code ",qmgr.reasonCode());
return RET_ERR;
}
qServer.setConnectionReference( qmgr );
qServer.setName( pi_q_name );
if (isForPut)
{
qServer.setOpenOptions(MQOO_OUTPUT + MQOO_INQUIRE
+ MQOO_FAIL_IF_QUIESCING );
}
else
{
qServer.setOpenOptions(MQOO_INPUT_AS_Q_DEF
+ MQOO_FAIL_IF_QUIESCING);
}
qServer.open();
if (qServer.reasonCode())
{
GetLastInfo("ImqQueue::open ended with reason code",qServer.reasonCode());
}
if (completionCode=qServer.completionCode())
{
GetLastInfo("ImqQueue::open ended with completion code",qServer.reasonCode());
return RET_ERR;
}
|
|
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 16, 2005 6:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
alperb wrote: |
Channelname is a server connection channel in the cluster, commtype is TCP, connection name is the IP of manager with the port assigned to cluster ,the queue manager name is empty and the queue name is cluster's shared queue. |
A "cluster manager" is just a regular queue manager, that happens to be acting as a repository for a cluster.
You have to specifically connect to a channel directly on the queue manager you want to connect to.
So your language above is very confusing.
Where is the 2085 being produced? It can't be coming from the connect, as it's not a valid RC from MQCONN or MQCONNX.
So likely you are establishing a good connection, you are just having issues with a different call. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alperb |
Posted: Wed Nov 16, 2005 6:48 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 25
|
The channel I am using is a server connection channel and the reason code is got upon an OPEN call.
I couldn't get the point "having issues with a different call." would you please clarify? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 16, 2005 7:31 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
alperb wrote: |
The channel I am using is a server connection channel and the reason code is got upon an OPEN call.
I couldn't get the point "having issues with a different call." would you please clarify? |
I meant, that the reason code is not coming from the connect, it's coming from something else - like the open.
This means that the connection is working fine.
Are you sure that the case of pi_q_name is correct? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alperb |
Posted: Thu Nov 17, 2005 12:32 pm Post subject: |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 25
|
pi_q_name is the queue name that is clustered and spelliing is correct.
I tried the same configuration in another mq cluster system. The same os/390 and two mq managers on open systems however this time mqmanagers are hosted on windows 2000 and the same code worked on this system .
I am confused  |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Nov 17, 2005 2:16 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Is the queue a QLOCAL on the server that works, and a QCLUSTER on the server that doesn't work? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sebastia |
Posted: Wed Nov 23, 2005 12:56 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
hopsala wrote: |
My guess is that you filled out RemoteQmgrName, instead of leaving it empty, but it's hard to tell with so little info - post relevant code snippet and return code and we'll have a look. |
No, no - Remote Queue Manager Name was not filled : we do not fill this field "manually", neither we use a "REMOTE QUEUE", wich dis-allows the clustering. We have a "Cluster Queue" visible, and we want to write into it.
This week I am training on WBI, but promise to write the RC next week ...
*** thnkx *** |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 23, 2005 11:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Maybe you need to define a cluster Alias (dummy qmgr name that resolves to a blank qgmr) in order to force the blank qmgr.
Some api's (like JMS) will default the connected qmgr if none is specified.
Enjoy  |
|
Back to top |
|
 |
sebastia |
Posted: Wed Nov 23, 2005 11:33 pm Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
fjb_saper wrote: |
Maybe you need to define a cluster Alias (dummy qmgr name that resolves to a blank qgmr) in order to force the blank qmgr.
Some api's (like JMS) will default the connected qmgr if none is specified.
Enjoy  |
*** THAT SOUNDS VERY INTERESTING ***
allow me few days to test it ....
I will trace to see a BLANK QMgr name in the message ...
tell you more next week - it's freezing in Madrid !
Cheers ! |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 25, 2005 5:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Mucho frio en Nueva York tambien....  |
|
Back to top |
|
 |
|