|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Event Message Date/Time |
« View previous topic :: View next topic » |
Author |
Message
|
chippyrich |
Posted: Mon Nov 19, 2012 6:22 pm Post subject: MQ Event Message Date/Time |
|
|
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 |
|
 |
lancelotlinc |
Posted: Tue Nov 20, 2012 7:06 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 20, 2012 8:47 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|