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 Index » IBM MQ API Support » Inquire channel status, how can I get reponse message?

Post new topic  Reply to topic
 Inquire channel status, how can I get reponse message? « View previous topic :: View next topic » 
Author Message
zlj
PostPosted: Thu Nov 13, 2008 9:30 pm    Post subject: Inquire channel status, how can I get reponse message? Reply with quote

Apprentice

Joined: 13 Nov 2008
Posts: 32

zlj wrote:
I have tryed this:
Code:

PCFMessageAgent agent = new PCFMessageAgent(queueManagerName);
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);

request.AddParameter(CMQCFC.MQCACH_CHANNEL_NAME, chennelName);
PCFMessage[] response = agent.Send(request);

MQMessage message = new MQMessage();
response[0].Write(message);


Then how can i get the status of channel?

Thank you.


Now I believe this is all i want.
Code:

((IBM.WMQ.PCF.MQCFIN)(response[0].GetParameters()[41])).StringValue


But how can i know the index 41? I guess CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS=42 means lots of things. So can i decide to change my code as following:
Code:

((IBM.WMQ.PCF.MQCFIN)(response[0].GetParameters()[(int)CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS])-1).StringValue


I am puzzled! Am I doing the right thing?

help me please!
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu Nov 13, 2008 10:05 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi zlj,
Code:
int currStatus = Integer.parseInt(response[0].getParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS).toString());

Regards.
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Nov 14, 2008 3:25 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Code:
PCFMessage[] response = agent.Send(request);
MQMessage message = new MQMessage();
response[0].Write(message);


This is very very confusing.

Code:

int currStatus = Integer.parseInt(response[0].getParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS).toString());


This is also confusing...

I have some old code that looks like
Code:
resetResponses = agent.send(request);
     switch (resetResponses[0].getIntParameterValue(MQConstants.MQIACH_CHANNEL_STATUS)) {
       case (MQConstants.MQCHS_BINDING):
        status = "BINDING";
      break;


But as I said, that's old code. I'm sure that the Javadoc that comes with MS0B is much more useful.
Back to top
View user's profile Send private message
zlj
PostPosted: Sun Nov 16, 2008 5:04 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Nov 2008
Posts: 32

First of all, thank you all very much. But it still have a problem.
When I use this code
Code:

int currStatus = response[0].GetIntParameterValue(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);


I got a Exception. Reason code id 3014 which means MQRCCF_CFIN_Param_ID_Error.

I have tryed other Parameter ID such like 0,1,2.... Still the same error.
I have tryed use another method "response[0].GetParameterValue", It does not work either.

What can i do now, please help me another time!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Nov 17, 2008 3:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

First of all, sorry for not noticing that you are using .NET and not Java.

Second of all, CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS is the pointer to the command, and not a pointer to any parameter that will be returned in the response message.

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.csqzac.doc/pc12480_.htm
Back to top
View user's profile Send private message
zlj
PostPosted: Mon Nov 17, 2008 6:20 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Nov 2008
Posts: 32

mqjeff wrote:
First of all, sorry for not noticing that you are using .NET and not Java.

Second of all, CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS is the pointer to the command, and not a pointer to any parameter that will be returned in the response message.

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.csqzac.doc/pc12480_.htm


LOL, I see.
Your kind reply greatly obliges me.
I define a trigger on XMITQ for auto-start channel, so I can get the channel status with is code:
Code:

int currStatus = response[0].GetIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS);


Thank you another time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Inquire channel status, how can I get reponse message?
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.