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 IBM MQ Support » Clearing old messages

Post new topic  Reply to topic
 Clearing old messages « View previous topic :: View next topic » 
Author Message
roshana
PostPosted: Tue May 20, 2014 7:49 am    Post subject: Clearing old messages Reply with quote

Newbie

Joined: 20 May 2014
Posts: 2

Hi Guys,

I have queues which are used by dev team and, they dont often consume messages from the queue. I got a request to create a script that will clear messages in the queue which are 'x' days old.

As I understand when I issue a clear command it will clear the entire messages in the queue. Is they any other way ?
Back to top
View user's profile Send private message
hughson
PostPosted: Tue May 20, 2014 7:53 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1959
Location: Bay of Plenty, New Zealand

You should check out QLOAD SupportPac MO03 - it can do EXACTLY that.

Look at the -T flag.

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
RogerLacroix
PostPosted: Tue May 20, 2014 8:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

I have posted to 2 different sample (complete) programs for clearing / emptying a queue:

1. ClearQ is a sample C MQAI code that will issue the clear queue command.
http://www.capitalware.com/mq_code_c.html

2. EmptyQ is a simple Java program to clear a queue of its messages.
http://www.capitalware.com/mq_code_java.html

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
PeterPotkay
PostPosted: Tue May 20, 2014 10:56 am    Post subject: Re: Clearing old messages Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

roshana wrote:
I got a request to create a script that will clear messages in the queue which are 'x' days old.

Request that they properly set the MQMD's Expiry field on their messages and MQ will take care of this for you.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
roshana
PostPosted: Wed May 21, 2014 3:41 am    Post subject: Reply with quote

Newbie

Joined: 20 May 2014
Posts: 2

Thank you guys, I will check all three suggestion in my lab.

Regards
Roshan
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 IBM MQ Support » Clearing old messages
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.