Author |
Message
|
mdncan |
Posted: Fri Mar 06, 2009 8:49 am Post subject: How to Archive messages older than 1 day? |
|
|
Acolyte
Joined: 11 May 2005 Posts: 59 Location: US
|
Hi,
I need to archive messages older than 1 day from Q1 to Q2, is there a free utility that I can use at customer location?
Please let me know if any IBM or third part utilities are available.
Thanks in advance!!!
Regards,
Mdn Can _________________ IBM Certified System Administrator- WebSphere Application Server, Network Deployment, V6.0
IBM Certified System Administrator - WebSphere MQ V6.0 |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Mar 06, 2009 8:55 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi mdncan,
You can either write a script which calls a java app. and reads the queue every 24hrs.
OR
You could expire the messages with report and trigger an app. on another queue.
OR
If you have an ESB, trigger a flow to archive msgs for you.
Regards. |
|
Back to top |
|
 |
mdncan |
Posted: Fri Mar 06, 2009 9:59 am Post subject: |
|
|
Acolyte
Joined: 11 May 2005 Posts: 59 Location: US
|
Thanks for the suggestion. We don't have any ESB.
I want explore different options, viz if any utilities available. so that was the reason for my post _________________ IBM Certified System Administrator- WebSphere Application Server, Network Deployment, V6.0
IBM Certified System Administrator - WebSphere MQ V6.0 |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Mar 06, 2009 2:14 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There should never be messages on a queue older than a day.
It's a queue, not a datastore. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Mar 06, 2009 3:01 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
This should be a pretty easy application to write:
1. browse the messages in the queue
2. look at create date/time in the MQMD
3. if you find that this message is older than your threshold, then get this message under cursor.
4. repeat until the queue is empty _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mdncan |
Posted: Thu Mar 12, 2009 7:36 am Post subject: |
|
|
Acolyte
Joined: 11 May 2005 Posts: 59 Location: US
|
Jeff,
mqjeff wrote: |
There should never be messages on a queue older than a day.
It's a queue, not a datastore. |
I don't know why there should never be messages in the queue older than a day, do you have a reason for that.
My understanding so far is queue's can hold messages until either the message expiry date is elapsed or a connected application consumes the messages. Pl. let me know if you have different theaory.
Thnx _________________ IBM Certified System Administrator- WebSphere Application Server, Network Deployment, V6.0
IBM Certified System Administrator - WebSphere MQ V6.0 |
|
Back to top |
|
 |
exerk |
Posted: Thu Mar 12, 2009 7:42 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
I think the point is that messages should be consumed ASAP. If messages sit on a queue for longer than one day it implies that WMQ is being used as a data store. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
zpat |
Posted: Thu Mar 12, 2009 7:44 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Support Pac MO71 (version 7) can move or copy messages (to a file or another queue) based on age criteria. See the UNLOAD/LOAD feature. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 12, 2009 7:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mdncan wrote: |
My understanding so far is queue's can hold messages until either the message expiry date is elapsed or a connected application consumes the messages. |
While your understanding is correct, the point my most worthy associate is making is that if it takes more than a day for the consuming application to process them, or for the expiry to pass, then you could face a number of issues depending on your design.
It's best practice, if a message can't be processed immediately, for it to be read from a queue and placed in an intermediate datastore until it can be processed. There's been a lot of discussion on the forum about this; a search may turn up items of interest to you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Mar 12, 2009 7:55 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
WMQ is very robust and doesn't lose messages; so in this sense, you could leave messages in queues forever. Most WMQ application designs put messages to queues, and the messages are consumed instantaneously. But this is not a requirement. However unlikely, if the queue becomes corrupt, there is a risk of losing messages.
WMQ uses logs to recover persistent messages (and state data, not necessarily relevant here). WMQ will demand that you mount all logs needed to recover at qmgr restart. This is just like DB2.
That said, WMQ is not a database. Your DBAs likely have application-oriented backups of database tables. This provides application-specific backup/recovery.
So, let's say that you put a message to a queue 23hrs, 59 seconds ago, and the queue becomes damaged. Your qmgr will likely have overwritten circular logs segments that contained your original persistent message. So, no WMQ recovery is possible for these messages.
For those that require long-lived messages (not consumed quickly), I recommend that you write an application that backs up the queue to a file from time to time, so that you can recover the queue, if needed. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Mar 12, 2009 8:32 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Let me add: WMQ qmgrs require logs to restart. If your logs become damaged (examples: disk failure, sunspots or EMF burst due to nuclear detonation), your long-lived messages are lost. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 12, 2009 8:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
Let me add: WMQ qmgrs require logs to restart. If your logs become damaged (examples: disk failure, sunspots or EMF burst due to nuclear detonation), your long-lived messages are lost. |
If the queue files themselves are still intact you might be ok; hence the advise to put logs & data on 2 different physical devices.
Of course this is only relevent if it's a very small & localised sunspot / EMF burst.
"And we will all go together when we go,
Suffused with an incandescant glow.
No one with have the endurance
To collect on their insurance.
Lloyds of London will be loaded
When they go"
With apologies to Tom Lehrer. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Mar 12, 2009 8:46 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
"Well, boom goes London,
And boom Paris.
More room for you
And more room for me.
And every city the whole world round
Will just be another American town.
Oh, how peaceful it'll be;
We'll set everybody free;
You'll have Japanese kimonos, baby,
There'll be Italian shoes for me.
They all hate us anyhow,
So let's drop the big one now.
Let's drop the big one now."
-Randy Newman _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
exerk |
Posted: Thu Mar 12, 2009 11:31 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
How I love this site! Not only do I learn more about the product every day, but also I broaden my horizon of knowledge about many other things
Thank you chaps, and please keep it up.
(Absolutely NO irony intended). _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
|