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 » Dealing with the MQException?

Post new topic  Reply to topic
 Dealing with the MQException? « View previous topic :: View next topic » 
Author Message
zlj
PostPosted: Thu Nov 13, 2008 11:09 pm    Post subject: Dealing with the MQException? Reply with quote

Apprentice

Joined: 13 Nov 2008
Posts: 32

Environment:
WINDOWS XP SP2
WebSphere MQ7.0
.ENT Framework2.0

I want to inquire the channel status, if MQ channel is inactive, an error occured.

How can i deal with the Exception.

Code:

try
            {
                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);

                ChannelStatus status = (ChannelStatus)Convert.ToInt32(((IBM.WMQ.PCF.MQCFIN)(response[0].GetParameters()[41])).StringValue);

                return status;
            }
            catch (MQException mqex)
            {
                //throw new Exception(mqex.ReasonCode);
            }
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Nov 14, 2008 5:42 am    Post subject: Re: Dealing with the MQException? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

zlj wrote:
I want to inquire the channel status, if MQ channel is inactive, an error occured.


An inactive channel has no status. Why are you inquiring about this? As previously discussed on the forum many times, there's no reason for the majority of applications to care about this.

zlj wrote:
How can i deal with the Exception.


There's nothing you can do except assume it's because the channel is inactive. Unless you mean "how do I consume the exception" in which case use any code you feel is relevant.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zlj
PostPosted: Sun Nov 16, 2008 5:39 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Nov 2008
Posts: 32

Quote:

An inactive channel has no status. Why are you inquiring about this?


In my situation, I need to do that. I want to config "IBM websphere MQ" with my application instead of using "IBM websphere MQ Resource Manager tools", for I have thousands of client have to deploy. IF I deploy client one by one, it debug me.

So i need a program to access MQ Mananger, such like create a queue, start a channel and so on. And i have implement most of them.

Now, I have a problem must figure out. That is start a channel whatever it's status, having status or not. First I should find channel have status or not , and then change it.

Thanks for you answer, I need more help.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Nov 16, 2008 6:06 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Usually things like that are done scripting mqsc.
Jeff can tell you which support pack will give you that capability in MQExplorer... Otherwise use runmqsc or mqsc (MO72).

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Dealing with the MQException?
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.