| Author | 
		  Message
		 | 
		
		  | adder | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 11:32 am    Post subject: how to write a fastpath application | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 06 Dec 2005 Posts: 43
  
  | 
		  
		    
			  
				I just change code based on imqsput.cpp as following, but when I run this application, an connection error 2012 got, which is MQRC_ENVIRONMENT_ERROR.  what other things need to do beside 
 
mgr.setConnectOptions(MQCNO_FASTPATH_BINDING); thanks
 
 
   
	| Code: | 
   
  
	mgr.setConnectOptions(MQCNO_FASTPATH_BINDING);
 
  if ( ! mgr.connect( ) ) {
 
 
    /* stop if it failed */
 
    printf( "ImqQueueManager::connect ended with reason code %d\n",
 
            (int)mgr.reasonCode( ) );
 
    exit( (int)mgr.reasonCode( ) );
 
  }
 
 | 
   
 
  Last edited by adder on Fri Apr 14, 2006 1:24 pm; edited 2 times in total | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 11:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired) 
  | 
		  
		    
			  
				Why do you want to do this?  Generally speaking, its very dangerous to do fast_path binding .   You do have to potential to destroy qmgr objects. _________________ -wayne | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | adder | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 12:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 06 Dec 2005 Posts: 43
  
  | 
		  
		    
			  
				
   
	| wschutz wrote: | 
   
  
	| Why do you want to do this?  Generally speaking, its very dangerous to do fast_path binding .   You do have to potential to destroy qmgr objects. | 
   
 
 
 
yes, I know that, but I just write some test application, I am sure no importance data in MQ. so don't worry about that, thanks | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 12:50 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired) 
  | 
		  
		    
			  
				Okay, as long as you understand that you could destory the qmgr....
 
 
how did you link the program?  (can you paste the link cmd?)  Is it a client or server set of MQ libraries that you used? _________________ -wayne | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | adder | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 1:05 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 06 Dec 2005 Posts: 43
  
  | 
		  
		    
			  
				
   
	| wschutz wrote: | 
   
  
	Okay, as long as you understand that you could destory the qmgr....
 
 
how did you link the program?  (can you paste the link cmd?)  Is it a client or server set of MQ libraries that you used? | 
   
 
 
 
server application,I have try threaded one and unthreaded one
 
   
	| Code: | 
   
  
	
 
g++ -o fastpath fastpath.cpp  -fsigned-char -I/opt/mqm/inc -L/opt/mqm/lib -Wl,-rpath=/opt/mqm/lib -Wl,-rpath=/usr/lib -limqs23gl_r -limqb23gl_r -lmqm_r
 
 
g++ -o fastpath fastpath.cpp -fsigned-char -I/opt/mqm/inc -L/opt/mqm/lib -Wl,-rpath=/opt/mqm/lib -Wl,-rpath=/usr/lib -limqs23gl -limqb23gl -lmqm
 
 | 
   
 
 
 
just copy from redbook "WebSphere MQ Using C++", and platform is linux
 
when using unthreaded lib,  run application , output is
 
[zengjia@wbi08 src]$ ./fastpath pingq ITQM
 
Sample IMQSPUT start
 
A non-threaded application tried to run as a Trusted application.
 
ImqQueueManager::connect ended with reason code 2012
 
 
when using threaded lib, run application , output is
 
[zengjia@wbi08 src]$ ./fastpath pingq ITQM
 
Sample IMQSPUT start
 
ImqQueueManager::connect ended with reason code 2012 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 1:14 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired) 
  | 
		  
		    
			  
				More questions.... what version and csd of MQ...also, if you don't include the "mgr.setConnectOptions(MQCNO_FASTPATH_BINDING); " in the program and rebuild it, I assume it runs okay? _________________ -wayne | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | adder | 
		  
		    
			  
				 Posted: Fri Apr 14, 2006 1:24 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 06 Dec 2005 Posts: 43
  
  | 
		  
		    
			  
				
   
	| wschutz wrote: | 
   
  
	| More questions.... what version and csd of MQ...also, if you don't include the "mgr.setConnectOptions(MQCNO_FASTPATH_BINDING); " in the program and rebuild it, I assume it runs okay? | 
   
 
 
 
[zengjia@wbi08 samp]$ dspmqver
 
Name:        WebSphere MQ
 
Version:     530.11  CSD11
 
CMVC level:  p530-11-L050802
 
BuildType:   IKAP - (Production)
 
 
[zengjia@wbi08 src]$ id
 
uid=512(zengjia) gid=512(zengjia) groups=512(zengjia),501(mqm)
 
 
 
yes, if don't include mgr.setConnectOptions, that's just imqsput.cpp, the sample c++ code provided by MQ. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | adder | 
		  
		    
			  
				 Posted: Mon Apr 17, 2006 3:51 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 06 Dec 2005 Posts: 43
  
  | 
		  
		    
			  
				| Have anybody write a fastpath application before, please help me, thanks very much. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |