ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ Event Message Date/Time

Post new topic  Reply to topic
 MQ Event Message Date/Time « View previous topic :: View next topic » 
Author Message
chippyrich
PostPosted: Mon Nov 19, 2012 6:22 pm    Post subject: MQ Event Message Date/Time Reply with quote

Newbie

Joined: 19 Nov 2012
Posts: 1

I am new to MQ, and am writing a Java program to read messages from the Event queues.
I can see the messages, but need to extract the Date and time they were added. Not sure if I should be looking in the MQMessage or the PCFMessage, and how to extract. With Config Events I am able to access parameters like MQCA_CREATION_DATE (2004), but these aren't available for QMGR and CHANNEL events.

Can anyone help?
An extract from the code is below:

Code:

String qName = "SYSTEM.ADMIN.QMGR.EVENT";
int openOptions = CMQC.MQOO_INPUT_AS_Q_DEF
 | CMQC.MQOO_INQUIRE
 | CMQC.MQOO_BROWSE
 | CMQC.MQOO_FAIL_IF_QUIESCING;
MQQueue queue = qMgr.accessQueue(qName, openOptions);
MQMessage retrievedMessage;
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.waitInterval = 500;
gmo.options = gmo.options | CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_BROWSE_NEXT;
boolean msgsavail = true;
while (msgsavail) {
   retrievedMessage = new MQMessage();
   try {
      queue.get(retrievedMessage, gmo);
      PCFMessage pcfMessage = new PCFMessage(retrievedMessage);
      ...
   } catch (MQException ex) {
      msgsavail = false;
      if (ex.reasonCode != CMQC.MQRC_NO_MSG_AVAILABLE) {
         System.out.println("Got an error: "+ex.getMessage());
      }
   } catch (IOException e) {
      msgsavail = false;
      e.printStackTrace();
   }
}
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Nov 20, 2012 7:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

MQMD has two fields you could reference: PutDate and PutTime.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Nov 20, 2012 8:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
MQMD has two fields you could reference: PutDate and PutTime.



Those would be in MQMessage, not in the PCFMessage.

But that tells you when the Event Message was Put to the event queue. It may or may not have any relationship with the Event being described by the the Event Message itself... so if the event message you're processing doesn't include date/time information as part of the event...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ Event Message Date/Time
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.