Author |
Message
|
patkatm |
Posted: Fri Jan 09, 2009 8:34 am Post subject: I get an error code: 2009 - MQRC_CONNECTION_BROKEN |
|
|
Newbie
Joined: 09 Jan 2009 Posts: 7
|
I m new to MQ development, developing MQ Client Application in C# .NET 2.0 with Windows XP environment. My MQ Server is in a remote location. When I execute the following piece of code I get an error code: 2009 - MQRC_CONNECTION_BROKEN.
PS: I m able to telnet to the MQ Server machine at Port (1414)
//--------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using IBM.WMQ;
namespace MQClient
{
public class MQClass
{
private MQQueueManager mqQMgr; // MQQueueManager instance
private String queueManger; // Name of queueManager to use
private String GetQName; // Name of Get queue to use
private String SndQName; // Name of Send queue to use
MQQueue mqSndQueue; // MQQueue Send instance
MQQueue mqGetQueue; // MQQueue Get instance
private String channelName;
private String connectionName;
public MQClass(string sChannelName)
{
channelName = "MYTEST.SVRCONN";
connectionName = "localhost";
SndQName = "MYTEST.QUEUE";
GetQName = "MYTEST.QUEUE.REPLY";
}
/// <summary>
/// Connect to MQ Server.
/// </summary>
/// <param name="sChannelName">Name of the Channel.</param>
/// <param name="sMachineIP">The Server machine's IP.</param>
/// <param name="sQMgrName">Name of the Q Manager.</param>
/// <param name="sQName">Name of the Q.</param>
/// <returns>True or false</returns>
public bool Connect2MQSrvr(string sChannelName, string sMachineIP, string sQMgrName, string sSndQName, string sGetQName)
{
bool bResult = true;
MessageBox.Show("Connect2MQSrvr... Enter.");
///
/// Try to create an MQQueueManager instance
///
try
{
//Channel Name
if (sChannelName.Length > 0)
channelName = sChannelName;
//Queue Manager Server IP
if (sMachineIP.Length > 0)
connectionName = sMachineIP;
//Queue Manager name
if (sQMgrName.Length > 0)
queueManger = sQMgrName;
//Send Queue name
if (sSndQName.Length > 0)
SndQName = sSndQName;
//Get Queue name
if (sGetQName.Length > 0)
GetQName = sGetQName;
MQEnvironment.Channel = channelName;
MQEnvironment.Hostname = connectionName;
MQEnvironment.Port = 1414;
mqQMgr = new MQQueueManager(queueManger, channelName, connectionName);
if (mqQMgr == null || !mqQMgr.IsConnected)
{
MessageBox.Show("Cannot Connect to " + connectionName +
" - QueueManager - " + queueManger + "ChannelName - " + channelName);
bResult = false;
}
else
MessageBox.Show("MQ Client connected to the Manager.");
}
catch (MQException mqe)
{
// stop if failed
MessageBox.Show("Connect2MQSrvr ended with an Error: " + mqe.Message + ", RCode: " + mqe.ReasonCode + ", Reason: " + mqe.Reason);
bResult = false;
}
MessageBox.Show("Connect2MQSrvr... Exit.");
return bResult;
}
}
}
//--------------------------------------------------------------------------
Looking forward your help at the earliest. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 09, 2009 9:44 am Post subject: Re: I get an error code: 2009 - MQRC_CONNECTION_BROKEN |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
patkatm wrote: |
Looking forward your help at the earliest. |
First thing is to learn to use the search facility in this forum!
2009 is a common problem with a number of possible causes, all of which have been discussed in here at one time or another with possible resolutions.
Note that some causes may not be connected to your code. But I suspect this is...
....unless this is just a fragment of the full application!
Hint - what is this reason code saying? What does it signify? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aditya.aggarwal |
Posted: Sun Jan 18, 2009 1:36 am Post subject: |
|
|
 Master
Joined: 13 Jan 2009 Posts: 252
|
Check with the Remote Server MQ Administration team that listner is running on that server.
there may be othere reasons. Ask your remote Mq Server adminstration team to investigate on the 2009 error. |
|
Back to top |
|
 |
sakthi_sarathi |
Posted: Sun Jan 18, 2009 3:59 am Post subject: |
|
|
 Novice
Joined: 07 Dec 2008 Posts: 16
|
I am really curious about this error, when I search in Google I see most of them end with either CPU resource issue on QMRG server or Network related issue.
Is this not really some thing to do with Application side?  |
|
Back to top |
|
 |
Vitor |
Posted: Sun Jan 18, 2009 5:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sakthi_sarathi wrote: |
Is this not really some thing to do with Application side?  |
Not typically, though the posted example may be the exception. Even having said that, I would not be astonished to discover a resource/network issue as well.
Badly written code, as with any situation, can of course exacerbate resource and network problems. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
patkatm |
Posted: Tue Jan 20, 2009 11:30 pm Post subject: Error: 2009 issue solve |
|
|
Newbie
Joined: 09 Jan 2009 Posts: 7
|
Thanks. This is was sorted out. I need to set: MQC.TRANSPORT_PROPERTY with MQC.TRANSPORT_MQSERIES_CLIENT and also install IBM MQ client setup in the target PC. |
|
Back to top |
|
 |
|