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 » WebSphere Message Broker (ACE) Support » Reason code 2059 on client (C#) when reconnecting to QM

Post new topic  Reply to topic
 Reason code 2059 on client (C#) when reconnecting to QM « View previous topic :: View next topic » 
Author Message
tlaukkanen
PostPosted: Fri Jun 04, 2010 1:50 am    Post subject: Reason code 2059 on client (C#) when reconnecting to QM Reply with quote

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
View user's profile Send private message
jonasb
PostPosted: Fri Jun 04, 2010 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Jun 04, 2010 2:27 am    Post subject: Reply with quote

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
View user's profile Send private message
tlaukkanen
PostPosted: Fri Jun 04, 2010 2:54 am    Post subject: How to properly disconnect from MQ QueueManager? Reply with quote

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
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 » WebSphere Message Broker (ACE) Support » Reason code 2059 on client (C#) when reconnecting to QM
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.