Author |
Message
|
parikh.vikas |
Posted: Wed Jan 19, 2011 11:35 am Post subject: Scenarios where JMSTimestamp header can be missing ... |
|
|
Newbie
Joined: 18 Jan 2011 Posts: 6
|
Hello Friends,
I am using JMS Provider as IBM MQ V7.0.1
what are the different scenarios where JMSTimestamp header can be missing (or value can be NULL / 0) in a JMS Message, when retrived using Message Consumer?
I am kind of aware of following scenarios ->
(1) javax.jms.MessageProducer.setDisableMessageTimestamp
When producer (publisher / sender) of the message invokes method ->
Code: |
setDisableMessageTimestamp(true) |
, it will be a hint to the JMS Provider to disable the JMSTimestamp to avoid overhead.
(2) When None Java Client sends message to the destination, JMSTimestamp header will not be availble at the time of receiving
message (I am not though fully sure about this)
I have following queries ->
(a) Are above scenarios valid, where JMSTimestamp (at time of receving) in a message will not be availble?
(b) Are there any other such scenarios?
(c) How can IBM MQ v7 server can be configured, such that JMSTimestamp header is always availbale in message, irrespective of above scenarios?
Your advice would be of great help.
Thanks in advance.
Vikas |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 19, 2011 11:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Presumably this is the same set up as you describe here?
If the timestamp isn't added by the sender (and has been deliberately disabled as you describe) why would you want to override that in the server? Why would the server provide the facility to override it?
And if a message arrives at a subscriber/consumer with a null timestamp, what value is there in adding it at that point? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
parikh.vikas |
Posted: Wed Jan 19, 2011 11:55 am Post subject: |
|
|
Newbie
Joined: 18 Jan 2011 Posts: 6
|
Yeah, set up is the same.
The scenario is like this:
I want to retrieve only those messages which are published 1 prior to the current time. So while creatig consumer, I use below Message Selector
Code: |
JMSTimestamp < (System.currentTimeMillis() - (60 * 1000)) |
In the above scenario, I can not tolerate missing JMSTimestamp header in a message otherwise messages with missing JMSTimestamp header will not be retrieved by above message selector.
Also, Note that I don't have control over the publisher of the message (it is all together different application), so I need to make congiguration on MQ server only to make sure that JMSTimestamp header is always available.
Thanks for the intrest.
Vikas |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 19, 2011 12:04 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Right, so suppose you do something to override the timestamp after the publisher sends it.
But something went slightly wrong with the publisher, such that they created the message three hours ago, but it didn't get to where you added the timestamp until now?
The timestamp you then add will match your selector - however the message will still be three hours old.
If you need to rely on information about when the message was sent, you need to ensure that it is tagged with the timestamp when it is sent. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 19, 2011 12:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
But something went slightly wrong with the publisher, such that they created the message three hours ago, but it didn't get to where you added the timestamp until now? |
Yes, that's what I was trying to articulate. Except you managed it.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 19, 2011 9:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The bigger question I have is why would you want to look at the timestamp in a selector like this?
This seems to me to be mostly irrelevant.
If you are looking at something for a monitoring app use oldest message age in queue as a primary discrimination. Remember to AND it with a qdepth greater than 0. The time spent processing the message before commit counts for the oldest message age...
You can then browse the queue and request the timestamp from each message and / or use a selector with your browser and it should hopefully come up with a message.
Why did I say hopefully? Well if your application has UOW issues and or commit issues the message older than your threshold might not be in a gettable/browsable state.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
parikh.vikas |
Posted: Thu Jan 20, 2011 1:32 am Post subject: |
|
|
Newbie
Joined: 18 Jan 2011 Posts: 6
|
Hi guys,
Thanks for the post.
Reason why i want to choose all messages prior to 1 min(it is configuarable) is process / business specific, can't handle this scenario, without message selector.
Message browsing & then receiving would lead to performance issues.
I think, instead of running into other alternatives, it would be great if you share your knowledge on
Quote: |
Is there any MQ server level configuration that can mandate the JMSTimestamp (may be server adds it, transparent to the publisher) in Message, when publisher has either prompted for disabling it / it is non java client.
|
Vikas |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 20, 2011 4:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The business requirement says that the message must have a JMSTimestamp on it.
If you have producers that are not creating the JMSTimestamp, then clearly they are not meeting the business requirement, and clearly are broken. |
|
Back to top |
|
 |
parikh.vikas |
Posted: Thu Jan 20, 2011 4:40 am Post subject: |
|
|
Newbie
Joined: 18 Jan 2011 Posts: 6
|
I have mentioned in my earlier post that ->
Quote: |
Also, Note that I don't have control over the publisher of the message (it is all together different application), so I need to make configuration on MQ server only to make sure that JMSTimestamp header is always available.
|
The publisher is a third party application, don't have choice to change / correct behavior, sometimes we don't have options to choose
Vikas |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 20, 2011 5:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
parikh.vikas wrote: |
The publisher is a third party application, don't have choice to change / correct behavior, sometimes we don't have options to choose  |
Then the third party application (which presumably someone in the business agreed to purchase) doesn't meet the business requirements. And the business are going to have to live with that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|