Author |
Message
|
steiner |
Posted: Tue Aug 07, 2012 3:43 am Post subject: Delete message from a queue from a number of days |
|
|
Voyager
Joined: 07 Mar 2003 Posts: 89
|
Hello,
i have a queue whwere i need to delete the message from a number of days.
exemple :
in that queue are messages from today to 6 months ago. So i want to keep all 30 days messages and delete the others.
I'm trying to do that with runmqsc but i think it will be better with Qload.
Could you please help me to find the right syntax. I think Qload must be installed (so ms03 pack)
Thanks a lot
Bye, Christian |
|
Back to top |
|
 |
exerk |
Posted: Tue Aug 07, 2012 3:52 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
SupportPac MS03 is saveqmgr, so you need SupportPac MA01 or SupportPac MO03. _________________ 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: Tue Aug 07, 2012 8:37 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
ma01 can remove them from the queue based on age (i.e. move them to a file). This can be run from the command line. |
|
Back to top |
|
 |
steiner |
Posted: Wed Aug 08, 2012 4:14 am Post subject: |
|
|
Voyager
Joined: 07 Mar 2003 Posts: 89
|
Hello,
yes sure it was a mistake mo03 or ma01.
So i have used qload for a queue that i must clear and keep just the 30 last days...My syntax is...
qload -m qmgrs -I QueueName -T30:0:0
But as i use -I it read all messages(get) and all the queue is cleared. So if i use -i it will not clear and keep the 30 last days...
Where is the error ....????
Thanks.... |
|
Back to top |
|
 |
exerk |
Posted: Wed Aug 08, 2012 4:25 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
steiner wrote: |
My syntax is...
qload -m qmgrs -I QueueName -T30:0:0
But as i use -I it read all messages(get) and all the queue is cleared. So if i use -i it will not clear and keep the 30 last days... |
The syntax of an example from the pdf, for moving messages older than one day from one queue to another, supplied with the SupportPac states: qload –m QM1 –I Q1 –o Q2 –T1440 _________________ 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 |
|
 |
steiner |
Posted: Wed Aug 08, 2012 4:53 am Post subject: |
|
|
Voyager
Joined: 07 Mar 2003 Posts: 89
|
Hello,
Thanks for your answer.
So it's right but there is not another way to just clear the messages with a number of days as parameter.
We must move to another queue, it's right???
thanks |
|
Back to top |
|
 |
exerk |
Posted: Wed Aug 08, 2012 4:59 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
steiner wrote: |
So it's right but there is not another way to just clear the messages with a number of days as parameter. |
I don't know. I just had a quick search in the pdf for syntax examples, and that one came up. It's possible that with a little testing you may find the syntax you're looking for, maybe try multiplying the -T figure by 30 perhaps?
steiner wrote: |
We must move to another queue, it's right??? |
I never delete application messages because expired or not they belong to the application owners, so moving them to another queue is a good idea anyway; you then place the responsibility of what is done with them on the owners  _________________ 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 |
|
 |
bruce2359 |
Posted: Wed Aug 08, 2012 5:04 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
exerk wrote: |
I never delete application messages because expired or not they belong to the application owners, so moving them to another queue is a good idea anyway; you then place the responsibility of what is done with them on the owners  |
It would be quite easy for the application team to write an app to look at the date/time, and destructively get the messages that are 'too old'. This method would meed both audit and best-practice. _________________ 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 |
|
 |
SAFraser |
Posted: Wed Aug 08, 2012 2:34 pm Post subject: |
|
|
 Shaman
Joined: 22 Oct 2003 Posts: 742 Location: Austin, Texas, USA
|
Sometimes with qload it takes more than one step.
You can see the age of messages on the queue with this:
qload –m QM1 –i Q1 –f (stdout)(or a file) -dT
This assumes that you are not dealing with hundreds of thousands of messages.
You can now see the age of the messages. You can see, for example, that you want to remove the first 2000 messages in the queue because they are older than your desired date.
You can use the -r option with -I to get just the first 2000 messages. You can output them to "-f stdout" if you don't want a copy in a file or queue. |
|
Back to top |
|
 |
|