Author |
Message
|
V&G |
Posted: Thu Oct 20, 2005 7:19 am Post subject: How to retrieve channel status |
|
|
Novice
Joined: 20 Oct 2005 Posts: 14
|
I have got an array of all channels and need to know what what's statuses of them.
PCFMessage pcfMsg = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
pcfMsg.AddParameter(new MQCFST(CMQCFC.MQCACH_CHANNEL_NAME, channelName));
pcfMsg.AddParameter(new MQCFIL(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, new int[] { CMQCFC.MQIACF_ALL } ));
PCFMessage[] pcfResponses = pcfAgent.Send(pcfMsg);
in last line I catched exception. The reason is MQRCCF_CHL_STATUS_NOT_FOUND. But MQ Explorer receives the statused someway...
Is there some method to obtain this information? |
|
Back to top |
|
 |
wschutz |
Posted: Thu Oct 20, 2005 7:32 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Might this be an issue of "saved' vs. "current" channel status?
Try specifying a channel instance type: MQIACH_CHANNEL_INSTANCE_TYPE _________________ -wayne |
|
Back to top |
|
 |
V&G |
Posted: Thu Oct 20, 2005 7:53 am Post subject: |
|
|
Novice
Joined: 20 Oct 2005 Posts: 14
|
Did you mean something like this:?
pcfMsg.AddParameter(new MQCFIL(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
new int[] { CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE } ));
If so, it's does not matter - the same exception
I think it's checks the command code before... |
|
Back to top |
|
 |
wschutz |
Posted: Thu Oct 20, 2005 9:31 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
No, I was think more of:
Code: |
pcfMsg.AddParameter(new MQCFIL(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
new int[] { MQOT_SAVED_CHANNEL } ));
|
The thought being that you might not have any active channels and the
info you're seeing in Explorer is the saved channel status. _________________ -wayne |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Oct 20, 2005 10:38 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
if the channel is new and unused there is no channel status. _________________ Regards, Butcher |
|
Back to top |
|
 |
wschutz |
Posted: Fri Oct 21, 2005 2:08 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
If there is no channel status, then I would expect that you would get the exception MQRCCF_CHL_STATUS_NOT_FOUND (which, of course, is what you get).
So, I'm not sure how you can be seeing any channel status in the explorer if the channel was *never* activated. _________________ -wayne |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Oct 21, 2005 2:47 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
dont know. i created a channel for test purposes (windows mq 5.3), then issued dis chstatus(mychl) current and dis chstatus(mychl) saved, and both ended with "no status found".
<edit>
had a quick test, for new and never activated channels the mqseries explorer says "there are no channel status entries for the channel"
</edit> _________________ Regards, Butcher |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 21, 2005 3:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yep.
Channels don't have a status until they've attempted to start at least once. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
V&G |
Posted: Mon Oct 31, 2005 12:13 am Post subject: |
|
|
Novice
Joined: 20 Oct 2005 Posts: 14
|
I have created a channel "SomeChannel".
Stoped it.
Started it.
Used it to send and receive some messages.
but...
the code
Code: |
PCFMessage pcfMsg = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
pcfMsg.AddParameter(new MQCFST(CMQCFC.MQCACH_CHANNEL_NAME, "SomeChannel"));
PCFMessage[] pcfResponses = agent.Send(pcfMsg);
|
returns MQRCCF_CHL_STATUS_NOT_FOUND.
IBM say:
"For Inquire Channel Status, no channel status is available for the specified channel. This may indicate that the channel has not been used."
What does it meen? How the channel should be used to get some status?
When I use MQSC command
I get all channels with all there statuses. What the reason the API does not returns same results? |
|
Back to top |
|
 |
wschutz |
Posted: Mon Oct 31, 2005 3:24 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
|
Back to top |
|
 |
V&G |
Posted: Tue Nov 01, 2005 10:15 pm Post subject: |
|
|
Novice
Joined: 20 Oct 2005 Posts: 14
|
I think now it's clear for me ....
When I use MQCMD_INQUIRE_CHANNEL_STATUS, I get the list of all channels that have SOME status other then MQCHS_INACTIVE.
Quote: |
The thought being that you might not have any active channels and the info you're seeing in Explorer is the saved channel status.
|
MQ Explorer does not rack one's brains - all channels not returned by MQCMD_INQUIRE_CHANNEL_STATUS displayed as "Inactive".
Of cause, if you open the status dialog, you will see there all channel statuses including SAVED one. But in list view.... it's tricky!
Thanks you all answered me! (wschutz specifically !) |
|
Back to top |
|
 |
|