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 » Handling expiry of the message

Post new topic  Reply to topic Goto page 1, 2, 3, 4  Next
 Handling expiry of the message « View previous topic :: View next topic » 
Author Message
christo
PostPosted: Mon Mar 24, 2014 9:08 am    Post subject: Handling expiry of the message Reply with quote

Newbie

Joined: 23 Mar 2014
Posts: 8

Hi,

I have created a message flow for browsing messages from a queue. Message flow created using one timeout notification node and one mq get node, timeout notification node will trigger the message during every second.Before doing browsing, i will put a message with expiry 120 sec and another one with 30 seconds. But both messages get expired at same time. I want to make first message expire after 120 sec and another one after 30 sec. Please help me to find a s solution for this problem.

Cheers,
Christo
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 24, 2014 9:39 am    Post subject: Re: Handling expiry of the message Reply with quote

Grand High Poobah

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

christo wrote:
Please help me to find a s solution for this problem.


Fix your design. Seriously. Browsing with a message flow is never a good idea.

Also you're assuming (incorrectly) that at the end of the expiry interval message go boom. The messages will remain in their expired state until the queue manager notices they're expired. As this happens on the next queue get operation, this will probably happen at the same time as you've discovered.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
christo
PostPosted: Mon Mar 24, 2014 9:59 pm    Post subject: Reply with quote

Newbie

Joined: 23 Mar 2014
Posts: 8

Thanks Victor for your reply.

My requirement is, i have 10 messages in a queue(Q1) with expiry set as 10 different timings. first message is having 30 sec expiry,and remining all having less than 30 sec .Am using a Browsing flow(MQ GET browse option with a timer node in every second) to browse the queue(Q1).But all message getting expired after 30 seconds only.can anyone suggest a solution for this(each message should exipre when its expiry time reached) ?
Back to top
View user's profile Send private message
atgeo
PostPosted: Mon Mar 24, 2014 10:26 pm    Post subject: Message Expiry Reply with quote

Newbie

Joined: 14 Mar 2014
Posts: 1

Do we really need a browsing flow to get the messages expired from the queue? If so, why?
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Tue Mar 25, 2014 1:09 am    Post subject: Re: Message Expiry Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

atgeo wrote:
Do we really need a browsing flow to get the messages expired from the queue? If so, why?


No. The answer was in Vitors reply
Quote:

The messages will remain in their expired state until the queue manager notices they're expired


Another MQPUT to the file will cause the deletion of expired messages. Browsing the queue as has been seen will to it but IMHO, it is not the best way of doing it.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
satya2481
PostPosted: Tue Mar 25, 2014 2:32 am    Post subject: Reply with quote

Disciple

Joined: 26 Apr 2007
Posts: 170
Location: Bengaluru

Hi smdavies99,
Could you please provide some more details on
Quote:
Another MQPUT to the file will cause the deletion of expired messages. Browsing the queue as has been seen will to it but IMHO, it is not the best way of doing it.
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Tue Mar 25, 2014 2:37 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Ok. The only way you are going to get the information on how it works is to ask IBM through a PMR.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Mar 25, 2014 3:22 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

It doesn't matter when the MQ scavenger task runs.

Expired messages will not be returned to any MQGET, whether they are on the queue or not.

All access to messages is via MQGET.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.


Last edited by zpat on Tue Mar 25, 2014 3:37 am; edited 1 time in total
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue Mar 25, 2014 3:22 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

In modern versions of MQ on mid tier systems there is a Expiry Scavenger process that starts up when the QM starts up. Check your AMQERR01.log the next time the QM starts up, you'll see it started.

This process runs periodically. Its not defined how often. Experimentation shows its about every 5 minutes. The process will purge expired messages from 'loaded' queues. Loaded queues are queues that are open by an app.

Messages are also purged from a queue when they are 'touched' by an app doing an MQ get looking for a message on the queue. So if you have 10 expired messages, a non expired messages and 5 more expired messages and you do a get, the first 10 will be purged, the 1 non expired will be returned, the remaining 5 wait on the queue in expired status, until another get or the scavenger gets them.

This is based on my own playing around. None of this is guaranteed. It can change at any time.

This is more detail than you need. All you really need to know is your app will never be returned an expired message.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
christo
PostPosted: Tue Mar 25, 2014 3:41 am    Post subject: Reply with quote

Newbie

Joined: 23 Mar 2014
Posts: 8

This particular queue contains only message with expiry set in MQMD.so the frst message in the q having an expiry 30 secnds and second msg having expiry 20 seconds.Currently both message is geting expired only after 30 seconds.My requiremnt is the first msg shloud get expired exacly at 20 secnds and second message after 30 secnds.i have flow which will keep on broswing the q in every seconds,but still its not wroking as expected
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Mar 25, 2014 3:47 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

You are confusing expiry with purging.

Expired - no longer available to any appliction or tool. You cannot even see them. The only way you know they are there is from CURDEPTH.

Purged - physically removed from queue.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.


Last edited by zpat on Tue Mar 25, 2014 3:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Tibor
PostPosted: Tue Mar 25, 2014 3:48 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

PeterPotkay wrote:
This process runs periodically. Its not defined how often. Experimentation shows its about every 5 minutes.

There is a parameter namely "ExpiryInterval" and its default value is 300 sec (=5 min). You can find more info about it on IBM support site:

http://www-01.ibm.com/support/docview.wss?uid=swg21288579
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Mar 25, 2014 3:51 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

The scavenger does not expire messages.

It removes expired messages. This is a key diffrence to grasp.

Messages will no longer be available, the moment that their expiry time is up.

What is the problem here? It seems perfectly simple to me and it works fine.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
christo
PostPosted: Tue Mar 25, 2014 4:16 am    Post subject: Reply with quote

Newbie

Joined: 23 Mar 2014
Posts: 8

I will be sending two request to two external system(Mq),at the same time i will put two msg in expiry q with report option enabled(30 seconds and 10 seconds).So if i didnt get reply from external system with in the time, i should get a report msg in replyto q of the expiry msg ,so i will come know extrenal system not replied with in time..The problom is ,suppose both extrenal system not responded with in time period, after 10 seconds one message should expire and a report msg should generated to mqmd.replytoQ of the exipred msg and after 30 seconds anothr msg should get expire and report should be generated.The problom is both report message am getting after 30 seconds only....
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 25, 2014 4:34 am    Post subject: Reply with quote

Grand High Poobah

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

christo wrote:
I will be sending two request to two external system(Mq),at the same time i will put two msg in expiry q with report option enabled(30 seconds and 10 seconds).So if i didnt get reply from external system with in the time, i should get a report msg in replyto q of the expiry msg ,so i will come know extrenal system not replied with in time..The problom is ,suppose both extrenal system not responded with in time period, after 10 seconds one message should expire and a report msg should generated to mqmd.replytoQ of the exipred msg and after 30 seconds anothr msg should get expire and report should be generated.The problom is both report message am getting after 30 seconds only....


Why do you need to expire messages to know if an external system which you communicate with over WMQ hasn't responded, given that your wait for the reply will expire?

If the answer is "because I want to get a report on expiry message with full data" then you've just discovered your design doesn't work.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3, 4  Next Page 1 of 4

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Handling expiry of the message
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.