| Author | 
		  Message
		 | 
		
		  | cmkeller | 
		  
		    
			  
				 Posted: Sun Jan 09, 2005 9:51 pm    Post subject: Client connection problems | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY 
  | 
		  
		    
			  
				I have an application that I wrote using MQI C++ classes which can use a client connection to get and put messages from and to a queue. I use ImqQueueManager::setChannelReference and everything works fine.
 
 
I now need to do some operations with the MQAI mqExecute function on the queue manager that I'm accessing via the client connection. In order to get a handle, I'm trying to use MQCONNX, but it's failing every time with error 2058. The following is the code I use:
 
 
   
	| Code: | 
   
  
	MQCNO         lmqod_conn_options = {MQCNO_DEFAULT};
 
MQCD         lmqod_channel_def = {MQCD_CLIENT_CONN_DEFAULT};
 
 
strcpy(lmqod_channel_def.ChannelName, (MQCHAR *) imqod_channel->channelName());
 
lmqod_channel_def.HeartbeatInterval = imqod_channel->heartBeatInterval();
 
strcpy(lmqod_channel_def.ConnectionName, (MQCHAR *) imqod_channel->connectionName());
 
lmqod_channel_def.TransportType = imqod_channel->transportType();
 
 
lmqod_conn_options.Version = MQCNO_CURRENT_VERSION;
 
lmqod_conn_options.ClientConnOffset = 0;
 
lmqod_conn_options.ClientConnPtr = &lmqod_channel_def;
 
 
MQCONNX(imqod_queue_mgr->name(), &lmqod_conn_options, &lmqh_connection_handle, &lmql_completion_code, &lmql_reason_code); | 
   
 
 
 
I also compiled the sample program amqscnxc.c and tried running it, and got the same error (2058) in failure. I know the names I'm using for host, channel and queue mgr are correct, because these same names work when I use the C++ class mentioned above - that's the "imqod" you see in the code snippet above. Any idea what I'm missing here?
 
 
(I'm using Websphere MQSeries 5.3 in a Windows XP environment)
 
 
Thanks so very much. _________________ Chaim Mattis Keller
 
Shadow Financial Services Corp
 
ckeller@shadowfinancial.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqmhr | 
		  
		    
			  
				 Posted: Sun Jan 09, 2005 10:03 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 28 Dec 2004 Posts: 105
  
  | 
		  
		    
			  
				| Specify the TCP port number as well. Ensure that a listener is running at this port and that the server connection channel is started. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | cmkeller | 
		  
		    
			  
				 Posted: Mon Jan 10, 2005 6:28 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY 
  | 
		  
		    
			  
				How do I specify port number? <host name>:<port number> for connection name? _________________ Chaim Mattis Keller
 
Shadow Financial Services Corp
 
ckeller@shadowfinancial.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Mon Jan 10, 2005 6:42 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| cmkeller wrote: | 
   
  
	| How do I specify port number? <host name>:<port number> for connection name? | 
   
 
 
 
Port numbers in connection names are always enclosed in parentheses.  
 
 
So <host name>(<port number>). _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | cmkeller | 
		  
		    
			  
				 Posted: Mon Jan 10, 2005 7:26 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY 
  | 
		  
		    
			  
				Well, I tried that (adding "(1414)" to my connection name) and it didn't change a thing.
 
 
I think there's got to be some value that's defaulted or properly set in ImqChannel or ImqQueueManager::SetChannelReference which is not being set when I try to use the raw form of MQCONNX. The connection works the C++ way, I successfully get and put messages! But I need that HCONN handle, without it I can't use the mqExecute function. _________________ Chaim Mattis Keller
 
Shadow Financial Services Corp
 
ckeller@shadowfinancial.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | cmkeller | 
		  
		    
			  
				 Posted: Mon Jan 10, 2005 7:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY 
  | 
		  
		    
			  
				Oh, and I should add: I checked the status of the server connection channel. On MQ Explorer, the channel status says it's inactive, but when I right-click and select "Start", that does nothing. In addition, the fact that it's (supposedly) inactive doesn't hurt anything when I'm using the C++ object to make the connection. _________________ Chaim Mattis Keller
 
Shadow Financial Services Corp
 
ckeller@shadowfinancial.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rajesh_avrs | 
		  
		    
			  
				 Posted: Sun Feb 20, 2005 4:07 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 May 2001 Posts: 31
  
  | 
		  
		    
			  
				The system where you are running the application, do you have MQSERVER environment variable set?  If yes, remove it and try running your code. _________________ ****************
 
MQSeries is cool
 
**************** | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | cmkeller | 
		  
		    
			  
				 Posted: Mon Feb 21, 2005 10:42 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY 
  | 
		  
		    
			  
				Thanks for the late reply. I since found the problem - I had been linking my app to the server library, mqm.lib, instead of the client library mqic32.lib. It now works just fine. _________________ Chaim Mattis Keller
 
Shadow Financial Services Corp
 
ckeller@shadowfinancial.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vennela | 
		  
		    
			  
				 Posted: Tue Feb 22, 2005 2:42 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India 
  | 
		  
		    
			  
				
   
	| rajesh_avrs wrote: | 
   
  
	| The system where you are running the application, do you have MQSERVER environment variable set?  If yes, remove it and try running your code. | 
   
 
 
AFAIK, this shouldn't really matter | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |