|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  How to get MQCFGR object out of activity report data sectio? | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | amitgoelamit | 
		  
		    
			  
				 Posted: Tue Jul 29, 2008 4:54 am    Post subject: How to get MQCFGR object out of activity report data sectio? | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 19 Jul 2008 Posts: 20
  
  | 
		  
		    
			  
				Hi
 
 
I am trying to read activity report and got some success in that.
 
 
As per Activity Report format given in chapter 13 of 'Monitoring WebSpehere MQ 6.0' the report has
 
 
1. Message Descriptor: which is MQMD
 
 
2. Message Data: has two parts
 
i. Embedded PCF header MQEPH structure - which also has PCF Header (MQCFH)
 
ii. Activity report message data - MQCFGR that has 
 
a. activityappname, 
 
b. activityappltype, 
 
c. activitydescription, 
 
d. Operation - it has MQMD and optional Embedded MQMD structure
 
e. TraceRoute
 
 
 
 
 
 
I was able to get the header information by using
 
   
	| Code: | 
   
  
	
 
               MQMessage message = new MQMessage ();
 
               MQGetMessageOptions gmo = new MQGetMessageOptions ();
 
               
 
               
 
               gmo.options = MQC.MQGMO_BROWSE_NEXT | MQC.MQGMO_NO_WAIT | MQC.MQGMO_CONVERT;
 
 
              // while (true)
 
              // {
 
                   message.messageId = null;
 
                   message.correlationId = null;
 
                   //PCFMessage p = new PCFMessage(message);
 
                   queue.get (message, gmo);
 
 
                   //     message.* apis to get all header information
 
               String applOriginData = message.applicationOriginData;
 
               int feedback = message.feedback;
 
               String format = message.format;
 
               int CCSID = message.characterSet;
 
               String applIdData = message.applicationIdData;
 
 
 
 | 
   
 
 
 
 
Also was able to read till 2(i)  Embedded PCF header MQEPH structure - which also has PCF Header (MQCFH) by using readInt and readStringOfCharLength() apis on MQMessage
 
 
	
   
	| Code: | 
   
  
	      mqMessage.seek(0); //Set read position back to the beginning of Message Data part
 
         int datalength, offset;
 
         
 
         datalength = mqMessage.getDataLength();
 
           offset = mqMessage.getDataOffset();
 
            System.out.println("datalength:"+ datalength + ", offset:"+offset);
 
 
         String ephStrucID        = mqMessage.readStringOfCharLength(4); //MQC.MQEPH_STRUC_ID
 
         datalength = mqMessage.getDataLength();
 
           offset = mqMessage.getDataOffset();
 
            System.out.println("datalength:"+ datalength + ", offset:"+offset);
 
            
 
         int ephVersion        = mqMessage.readInt();     //MQEPH_VERSION_1 
 
         datalength = mqMessage.getDataLength();
 
           offset = mqMessage.getDataOffset();
 
            System.out.println("datalength:"+ datalength + ", offset:"+offset);
 
   | 
   
 
 
 
I have following questions:
 
 
How to use the the  MQCFH, MQMD, MQCFGR data in the data section of activity report into the respective classes (MQCFH, MQMD, MQCFGR) in java.
 
 
 
 
I tried using 
 
 
   
	| Code: | 
   
  
	MQCFH mqcfh = (MQCFH)mqMessage.readObject();
 
and 
 
MQCFH mqcfh = new MQCFH(mqMessage)
 
 
MQCFGR mqcfgr = (MQCFGR)mqMessage.readObject();
 
and 
 
MQCFGR mqcfgr= new MQCFGR(mqMessage) | 
   
 
 
 
but, it didnt work.. threw
 
 
java.io.StreamCorruptedException: invalid stream header
 
 
Also tried 
 
   
	| Code: | 
   
  
	| PCFMessage pcf = new PCFMessage(mqMessage); | 
   
 
 
 
so, in case can get pcf handle then may try using getParameter() methods to get handle on MQCFGR object etc.
 
but, it threw 
 
 
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 3001
 
 
 
any suggestion .. guidance !!!! | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |