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 » How to retrieve channel status

Post new topic  Reply to topic
 How to retrieve channel status « View previous topic :: View next topic » 
Author Message
V&G
PostPosted: Thu Oct 20, 2005 7:19 am    Post subject: How to retrieve channel status Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Thu Oct 20, 2005 7:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
V&G
PostPosted: Thu Oct 20, 2005 7:53 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Thu Oct 20, 2005 9:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Mr Butcher
PostPosted: Thu Oct 20, 2005 10:38 pm    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

if the channel is new and unused there is no channel status.
_________________
Regards, Butcher
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri Oct 21, 2005 2:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Mr Butcher
PostPosted: Fri Oct 21, 2005 2:47 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Oct 21, 2005 3:09 am    Post subject: Reply with quote

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
View user's profile Send private message
V&G
PostPosted: Mon Oct 31, 2005 12:13 am    Post subject: Reply with quote

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
Code:
get chs(*)

I get all channels with all there statuses. What the reason the API does not returns same results?
Back to top
View user's profile Send private message
wschutz
PostPosted: Mon Oct 31, 2005 3:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

See the code sample here:

http://www.mqseries.net/phpBB2/viewtopic.php?t=25026

If the channel isn't running, then these is no ACTIVE status and you must ask for the SAVED status. The default is to get the ACTIVE status.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
V&G
PostPosted: Tue Nov 01, 2005 10:15 pm    Post subject: Reply with quote

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
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 » How to retrieve channel status
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.