|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Dealing with the MQException? |
« View previous topic :: View next topic » |
Author |
Message
|
zlj |
Posted: Thu Nov 13, 2008 11:09 pm Post subject: Dealing with the MQException? |
|
|
 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 |
|
 |
Vitor |
Posted: Fri Nov 14, 2008 5:42 am Post subject: Re: Dealing with the MQException? |
|
|
 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 |
|
 |
zlj |
Posted: Sun Nov 16, 2008 5:39 pm Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Sun Nov 16, 2008 6:06 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|