| Author | 
		  Message
		 | 
		
		  | AITKENM | 
		  
		    
			  
				 Posted: Fri Apr 01, 2005 2:32 am    Post subject: MQRFH MQRFH2 | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 19 Mar 2005 Posts: 3
  
  | 
		  
		    
			  
				Hi,
 
I am developing an app to simply read messages from a queue.  I am a little confused as to the best practise for handling different header values.  At the moment I check to see if the message descriptor Format is MQRFH. If it is I cast the message recived to a MQRFH and then use the format field of that to determine if I have a MQRFH2 header.  Is this correct or is there a preferred way of doing this.
 
Thanks
 
Mark. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | malammik | 
		  
		    
			  
				 Posted: Fri Apr 01, 2005 6:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Partisan
 
 Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | AITKENM | 
		  
		    
			  
				 Posted: Fri Apr 01, 2005 7:40 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 19 Mar 2005 Posts: 3
  
  | 
		  
		    
			  
				Hi Thanks for the feedback, Basically I am writing in CPP.  If the MD Format is MQRFH then I cast the Data received to one of those structures, I then can access the header information through my pointer.  Will the MD Format ever be MQRFH2?
 
 
Cheers
 
Mark. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | malammik | 
		  
		    
			  
				 Posted: Fri Apr 01, 2005 7:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Partisan
 
 Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Fri Apr 01, 2005 9:46 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				But RFH and RFH2 headers have different Format names:
 
   
	| Quote: | 
   
  
	MQFMT_RF_HEADER  'MQHRFbbb'  
 
MQFMT_RF_HEADER_2  'MQHRF2bb'  
 
 | 
   
 
 
So, you can't use the Format for one, but the "payload" for the other.
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Fri Apr 01, 2005 1:52 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				And I would be very carefull with all that "casting".
 
Think about pointer/memory overflows and all that stuff.
 
 
Enjoy    | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |