|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Inquire channel status, how can I get reponse message? |
« View previous topic :: View next topic » |
Author |
Message
|
zlj |
Posted: Thu Nov 13, 2008 9:30 pm Post subject: Inquire channel status, how can I get reponse message? |
|
|
 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 |
|
 |
elvis_gn |
Posted: Thu Nov 13, 2008 10:05 pm Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Nov 14, 2008 3:25 am Post subject: |
|
|
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 |
|
 |
zlj |
Posted: Sun Nov 16, 2008 5:04 pm Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Mon Nov 17, 2008 3:28 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
zlj |
Posted: Mon Nov 17, 2008 6:20 pm Post subject: |
|
|
 Apprentice
Joined: 13 Nov 2008 Posts: 32
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|