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 » WebSphere Message Broker (ACE) Support » Setting MQMD.Expiry value

Post new topic  Reply to topic
 Setting MQMD.Expiry value « View previous topic :: View next topic » 
Author Message
siljcjose
PostPosted: Wed May 14, 2008 12:04 am    Post subject: Setting MQMD.Expiry value Reply with quote

Apprentice

Joined: 18 Aug 2005
Posts: 27

Hi,

I have a simple requirement that the message in a input queue has to expire after 3 months, if the message is not picked up from the queue.

I put a simple line like this SET OutputRoot.MQMD.Expiry = CAST((CURRENT_TIME + INTERVAL '1' SECOND ) AS GMTTIMESTAMP);

But now when i change this to

When i cahne it to this statement SET OutputRoot.MQMD.Expiry = CAST((CURRENT_TIME + INTERVAL '3' MONTH ) AS GMTTIMESTAMP); it throws an exception at runtime as illegal interval operation.

Please can any one help me with the syntax.

Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 14, 2008 12:33 am    Post subject: Re: Setting MQMD.Expiry value Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

siljcjose wrote:
Please can any one help me with the syntax.


The syntax is fine. The problem is the expiry value is not a timestamp - it's the number of milliseconds left before the message expires.

I don't know if the field is large enough to hold enough milliseconds for 3 months (and too lazy to multiply the value out anyway), but shudder to think at a system where messages sit for 3 months without being processed!

3 minutes unprocessed make some site gibber (which is why it's an interval).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sri_csee1983
PostPosted: Wed May 14, 2008 12:33 am    Post subject: Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

Since I havent used Expiry in Set Stmt of broker,

As u told it is working for

SET OutputRoot.MQMD.Expiry = CAST((CURRENT_TIME + INTERVAL '1' SECOND )

Did u try with

SET OutputRoot.MQMD.Expiry = CAST((CURRENT_TIME + INTERVAL '7776000' SECOND )

which is the seconds for 90 days.

? May be working.
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vitor
PostPosted: Wed May 14, 2008 12:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sri_csee1983 wrote:

which is the seconds for 90 days.


We're both wrong about Expiry - I'm wrong about it being milliseconds, you're wrong about it being seconds.

It's tenth of a second.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
siljcjose
PostPosted: Wed May 14, 2008 1:34 am    Post subject: Reply with quote

Apprentice

Joined: 18 Aug 2005
Posts: 27

Thanks for the reply.
I changed the code do this and i got the expected behavior.

SET OutputRoot.MQMD.Expiry = CAST((CURRENT_DATE + INTERVAL '3' MONTH) AS GMTTIMESTAMP);
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 14, 2008 2:01 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

siljcjose wrote:
Thanks for the reply.
I changed the code do this and i got the expected behavior.

SET OutputRoot.MQMD.Expiry = CAST((CURRENT_DATE + INTERVAL '3' MONTH) AS GMTTIMESTAMP);
Did you verify that the message would indeed expire after 3 months? I would have expected to find your value in the OutputRoot.Properties....

For MQMD:(verify the syntax as I'm working from memory here)

declare expval integer value 0;
SET expval = cast (Interval '3' month) AS interval seconds;
SET expval = expval * 10;

SET OutputRoot.MQMD.Expiry = expval;

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
joebuckeye
PostPosted: Wed May 14, 2008 6:32 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

The Expiry field in the MQMD is a special case. The Info Center has this blurb about the Expiry field:

Quote:
The Expiry field in the MQMD is a special case:
- An INTEGER value represents an expiry interval in tenths of a second. If the Expiry field is set to -1, it represents an unlimited expiry interval (that is, the message never expires) If the Expiry field is a positive INTEGER, it represents an expiry interval of that number of tenths of a second (for example, if it is set to 4, it represents 4 tenths of a second, if it is set to 15, it represents one and a half seconds).
- A GMTTIMESTAMP value represents a specific expiration time.
If Expiry contains a GMTTIMESTAMP in the past, or an INTEGER of less than 1 (excluding -1), it is set to the value 1 (one tenth of a second, the minimum value).


So it can be an integer or a timestamp.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 14, 2008 7:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

joebuckeye wrote:
The Expiry field in the MQMD is a special case. The Info Center has this blurb about the Expiry field:


Which Info Centre? WMB? It doesn't say that in the WMQv6 APR (unless I've accidently exceeded my caffine quota for today)!


http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzak.doc/js01159.htm
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
siljcjose
PostPosted: Wed May 14, 2008 12:08 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Aug 2005
Posts: 27

Though i gave a Timestamp value as this (CAST((CURRENT_DATE + INTERVAL '3' MONTH) AS GMTTIMESTAMP) , when i tried browsing the message for which the expiry was set to 3 months i could see the interval in 10's of second. ie a value of 77760000, which was ticking down each time i browsed.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 14, 2008 2:22 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

siljcjose wrote:
Though i gave a Timestamp value as this (CAST((CURRENT_DATE + INTERVAL '3' MONTH) AS GMTTIMESTAMP) , when i tried browsing the message for which the expiry was set to 3 months i could see the interval in 10's of second. ie a value of 77760000, which was ticking down each time i browsed.

Yup looks like 90 days in 10ths of seconds.

Congrats. it works

The interval vs GMTTIMESTAMP seems to be a 6.1 feature:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ad09700_.htm
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Wed May 14, 2008 11:20 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fjb_saper wrote:
The interval vs GMTTIMESTAMP seems to be a 6.1 feature:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ad09700_.htm


Is there no limit to the advances possible to those clever people at IBM?



I have so got to get me some time with WMBv6.1!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Thu May 15, 2008 5:38 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

Vitor wrote:
joebuckeye wrote:
The Expiry field in the MQMD is a special case. The Info Center has this blurb about the Expiry field:


Which Info Centre? WMB? It doesn't say that in the WMQv6 APR (unless I've accidently exceeded my caffine quota for today)!


http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzak.doc/js01159.htm


Sorry.

I found it under the MQMD Parser section for WMB 6.0 (not 6.1).

Here is the link:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad09700_.htm

Now we haven't used it has a timestamp yet but we did document that it should be possible.
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 » WebSphere Message Broker (ACE) Support » Setting MQMD.Expiry value
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.