| Author | 
		  Message
		 | 
		
		  | a269652 | 
		  
		    
			  
				 Posted: Thu May 23, 2002 4:35 am    Post subject: Putting a message on an RS6000/AIX MQSeries Queue | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 11
  
  | 
		  
		    
			  
				MQSeries 5.2/ MQSI 2.0.1/ RS6000/AIX
 
 
I have a flat text file residing in an AIX directory & I want to place it in a message on a queue on the same machine. How might I achieve this? Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqonnet | 
		  
		    
			  
				 Posted: Thu May 23, 2002 4:42 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa. 
  | 
		  
		    
			  
				One of the ways to achieve this is by reading the entire contents of the file into an array/pointer variable within your app and put this buffer into your MQPUT call.
 
 
In case you need it as a file at the other end, just reverse the process.
 
 
Cheers.
 
Kumar _________________ IBM Certified WebSphere MQ V5.3 Developer
 
IBM Certified WebSphere MQ V5.3 Solution Designer
 
IBM Certified WebSphere MQ V5.3 System Administrator | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | a269652 | 
		  
		    
			  
				 Posted: Thu May 23, 2002 4:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 11
  
  | 
		  
		    
			  
				| Can someone please suggest a suitable app for this purpose? Are there any existing ones within MQ that I can use rather than writing one? Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqonnet | 
		  
		    
			  
				 Posted: Thu May 23, 2002 5:03 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa. 
  | 
		  
		    
			  
				Well i am not aware of any such utility, but there could be some support pacs.  Would surely want to know if there is one.
 
 
Cheers.
 
Kumar _________________ IBM Certified WebSphere MQ V5.3 Developer
 
IBM Certified WebSphere MQ V5.3 Solution Designer
 
IBM Certified WebSphere MQ V5.3 System Administrator | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Thu May 23, 2002 6:43 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				| Couldn't you also use a reference message?  I've never messed with them, but I thought that they allowed you to pass a reference to a file.  You then used a channel exit to read the file and send it along.  A similar channel exit on the other side would create the file.  There is an example in the MQSeries Version 5 Programming Examples Redbook. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | RogerLacroix | 
		  
		    
			  
				 Posted: Thu May 23, 2002 8:07 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 15 May 2001 Posts: 3265 Location: London, ON  Canada 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | a269652 | 
		  
		    
			  
				 Posted: Thu May 23, 2002 11:12 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 11
  
  | 
		  
		    
			  
				| Could I also use 'amqsput' ? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Ward | 
		  
		    
			  
				 Posted: Fri May 24, 2002 12:01 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Voyager
 
 Joined: 27 Jun 2001 Posts: 98 Location: Europe 
  | 
		  
		    
			  
				Hi,
 
 
amqsput queue qmgr < filename
 
 
will read your file and output one message for each line within the file
 
 
Cheers,
 
 
Ward. _________________ IBM Certified Solution Designer -- WebSphere MQ V6.0
 
IBM Certified Solution Developer - WebSphere Message Broker V6.0
 
----------------------------
 
Visit Boat Dimensions | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | dgolding | 
		  
		    
			  
				 Posted: Fri May 24, 2002 12:05 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Yatiri
 
 Joined: 16 May 2001 Posts: 668 Location: Switzerland 
  | 
		  
		    
			  
				You could, but AMQSPUT has a (I think) 80 byte max message length - so you need to change that and recompile if your text  lines are bigger. AMQSGET with standard output redirected to a file could pull the messages off to a file on the other end.
 
 
BUT AMQSGET wraps <> around the message, so you would need (if you are using a sensible Unix platform an not some silly Microsoft one) to use "sed" or something to strip of the <>:
 
 
 cat f1|grep '^message'|sed 's/message <//'|sed 's/>$//'>f2
 
 
Of course, this is a kludge, some sort of basic file->message->file utility would be better.
 
 
HTH | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |