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 » putDateTime

Post new topic  Reply to topic
 putDateTime « View previous topic :: View next topic » 
Author Message
ohkats
PostPosted: Sat Nov 29, 2003 12:21 am    Post subject: putDateTime Reply with quote

Newbie

Joined: 29 Nov 2003
Posts: 2

Hi,

A Put a msg in a Q, & read the PutTime, it shows properly.
Next I save the MsgId, create a new Msg var (as below) &
try to read PutTime (of same msg) , it gives NullPointerEx.. why ?

I am able to read the Msg below however.. (note I am creating
a completely new connection again to same Q & then reading
in another func as below...)

MQMessage mGet= new MQMessage();
mGet.messageId = lMsgId; // My saved MsgId
qTime = mGet.putDateTime.getTime();
System.out.println("The putTime was: " + qTime);

Regards,
KS
Back to top
View user's profile Send private message
bower5932
PostPosted: Wed Dec 03, 2003 12:03 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I believe you are getting the exception because you are trying to read a field in a message that has never been put. Without looking at the spec, I can't say if this is the specified behavior or not.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
vids
PostPosted: Thu Dec 04, 2003 3:09 pm    Post subject: Reply with quote

Acolyte

Joined: 24 Mar 2003
Posts: 68
Location: CA, USA

MQMessage mGet= new MQMessage(); -->>> Here you are creating a MQMessage object
mGet.messageId = lMsgId; // My saved MsgId -->> Here you are setting the old message id to new message object
-->> Here you pull or put the message from/to the queue
Now try to capture the putDataTime as below
qTime = mGet.putDateTime.getTime();
System.out.println("The putTime was: " + qTime);
_________________
Vids
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Dec 05, 2003 6:18 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I think I'm confused:
Quote:

mGet.messageId = lMsgId; // My saved MsgId -->> Here you are setting the old message id to new message object

I thought this was saving the message id from the old message into the message id of the new message? What makes you think that it is saving the whole message (ie, the puttime)?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
ohkats
PostPosted: Sun Dec 07, 2003 9:11 pm    Post subject: Reply with quote

Newbie

Joined: 29 Nov 2003
Posts: 2

bower5932 wrote:

Quote:

mGet.messageId = lMsgId; // My saved MsgId -->> Here you are setting the old message id to new message object

I thought this was saving the message id from the old message into the message id of the new message? What makes you think that it is saving the whole message (ie, the puttime)?


... I thought this is how U access an existing message in a Q if U knew its MsgID .. sort of like a pointer to an existing msg in a Q...
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Dec 08, 2003 8:09 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

A MsgId is just one property of a message. It isn't the entire message. You can use the Msgid to access a message on a queue. You can do a get by MsgId to get a particular message. However, it looks like you are trying to make a copy of the message and not try the get.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
vids
PostPosted: Mon Dec 08, 2003 11:07 am    Post subject: Reply with quote

Acolyte

Joined: 24 Mar 2003
Posts: 68
Location: CA, USA

guys,

mGet.messageId = lMsgId; // My saved MsgId -->> Here you are setting the old message id to new message object

Here what I mean is you are setting the old message id to the message id of the new message object.(Sorry my statement was not very clear)

Now once you set your saved MsgId to the messageId of the new message, try to give
get call.

Whate it does is, it pulls only the message which matches the messageid.
after pulling the message you can find putDateTime as below
qTime = mGet.putDateTime.getTime();

Which shows at what time this message was put to the queue by putting application and it will be in GMT format.
_________________
Vids
Back to top
View user's profile Send private message
kman
PostPosted: Thu Dec 11, 2003 12:15 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2003
Posts: 309
Location: Kuala Lumpur, Malaysia

mGet is a new message object.
Puttime is the time when you put the message.
If you are trying to get the put time on mGet, there is none. You haven't put the message yet, how can you get the time?
If you want to get the puttime of the message on the queue, then it is possible.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » putDateTime
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.