|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Reason code 2059 on client (C#) when reconnecting to QM |
« View previous topic :: View next topic » |
Author |
Message
|
tlaukkanen |
Posted: Fri Jun 04, 2010 1:50 am Post subject: Reason code 2059 on client (C#) when reconnecting to QM |
|
|
Newbie
Joined: 04 Jun 2010 Posts: 2
|
I can't reconnect to MQQueueManager after a while as an exception (2059 - MQRC_Q_MGR_NOT_AVAILABLE) is thrown when I'm constructing new object of MQQueueManager. My client app is written in .NET/C# and I'm running it on Win2003.
However I can connect to QM after I have restarted my client app. This would indicate that some state is incorrect in QM libraries? How can I reset the state in code so that I could reconnect to QM? Is there a way to reset/disconnect all active TCP connections to QM from client app code?
My connection code:
Code: |
Hashtable connectionProperties = new Hashtable();
connectionProperties.Add( MQC.HOST_NAME_PROPERTY, Host );
connectionProperties.Add( MQC.PORT_PROPERTY, Port );
connectionProperties.Add( MQC.USER_ID_PROPERTY, UserId );
connectionProperties.Add( MQC.PASSWORD_PROPERTY, Password );
connectionProperties.Add( MQC.CHANNEL_PROPERTY, ChannelName );
connectionProperties.Add( MQC.TRANSPORT_PROPERTY, TransportType );
MQQueueManager queueManager = new MQQueueManager( QueueManagerName, connectionProperties ); |
StackTrace:
Code: |
Source: amqmdnet
CompletionCode: 2
ReasonCode: 2059
Reason: 2059
Stack Trace:
at IBM.WMQ.MQBase.throwNewMQException()
at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
at WebSphereMQOutboundAdapter.WebSphereMQOutbound.ConnectToWebSphereMQ() |
I would appriciate any hints or help. I've tried to search the forum for similar problems but they seem vary in some ways. |
|
Back to top |
|
 |
jonasb |
Posted: Fri Jun 04, 2010 2:19 am Post subject: |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
I would look in the MQ logs for a reason. It could hold the answer. Reason code 2059 is returned on many types of errors.
E.g.
It could be that you have some program error which "consumes" client channels. In that case you would have a AMQ9513 in the mq log.
(that would explain why it works when you restart the application and a cleanup of all consumed channels are performed)
/contact admin _________________ contact admin |
|
Back to top |
|
 |
zpat |
Posted: Fri Jun 04, 2010 2:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
2059 means a queue manager of that name is not found on that host at that port. Or there is no listener running on that port.
Get them all 100% correct and it will work. More obscure explanations are possible but unlikely if you are just starting to use MQ. |
|
Back to top |
|
 |
tlaukkanen |
Posted: Fri Jun 04, 2010 2:54 am Post subject: How to properly disconnect from MQ QueueManager? |
|
|
Newbie
Joined: 04 Jun 2010 Posts: 2
|
Thanks for fast replies! I also think that the reason is related to used connection count.
Related to this, is this a best way to disconnect from MQ? I start to get the 2059 after I have disconnected from the queue manager with the code below.
Code: |
// Queue is an instance of MQQueue
if (Queue != null)
{
Queue.Close();
Queue = null;
}
// QueueManager is an instance of MQQueueManager
if (QueueManager != null)
{
QueueManager.Disconnect();
QueueManager.Close();
QueueManager = null;
} |
|
|
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
|
|
|
|