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 » General Discussion » Delete message from a queue from a number of days

Post new topic  Reply to topic
 Delete message from a queue from a number of days « View previous topic :: View next topic » 
Author Message
steiner
PostPosted: Tue Aug 07, 2012 3:43 am    Post subject: Delete message from a queue from a number of days Reply with quote

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
View user's profile Send private message
exerk
PostPosted: Tue Aug 07, 2012 3:52 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Tue Aug 07, 2012 8:37 am    Post subject: Reply with quote

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
View user's profile Send private message
steiner
PostPosted: Wed Aug 08, 2012 4:14 am    Post subject: Reply with quote

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
View user's profile Send private message
exerk
PostPosted: Wed Aug 08, 2012 4:25 am    Post subject: Reply with quote

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
View user's profile Send private message
steiner
PostPosted: Wed Aug 08, 2012 4:53 am    Post subject: Reply with quote

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
View user's profile Send private message
exerk
PostPosted: Wed Aug 08, 2012 4:59 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Wed Aug 08, 2012 5:04 am    Post subject: Reply with quote

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
View user's profile Send private message
SAFraser
PostPosted: Wed Aug 08, 2012 2:34 pm    Post subject: Reply with quote

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
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 » General Discussion » Delete message from a queue from a number of days
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.