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 » IBM MQ API Support » Deleting a particular number of Messages from the Queue

Post new topic  Reply to topic
 Deleting a particular number of Messages from the Queue « View previous topic :: View next topic » 
Author Message
VijayGoparaju`
PostPosted: Mon Mar 02, 2009 2:59 am    Post subject: Deleting a particular number of Messages from the Queue Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Hi All,
I have a requirement, I want to delete a particular number of messages from a queue (ex: If I have 50 messages in a Queue I want to delete messages from 20 to 30).
I have checked the methods but i didnt found any.Please help me
Thanks,
Vijay...
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 02, 2009 3:02 am    Post subject: Re: Deleting a particular number of Messages from the Queue Reply with quote

Grand High Poobah

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

VijayGoparaju` wrote:
I have a requirement, I want to delete a particular number of messages from a queue (ex: If I have 50 messages in a Queue I want to delete messages from 25 to 50).


It's a rather odd requirement. Typcially you'd flush the entire queue, or delete by date, or delete by content.

VijayGoparaju` wrote:
I have checked the methods but i didnt found any.


There's nothing out of the box that will do this. If it's a one-off task you could unload the queue, delete the messages you want and reload the queue; if it's an on-going task you'll need to write an app to do it.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Mon Mar 02, 2009 3:29 am    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

There are many utils/supportpacks like MO71 which helps you to do this...

If you want to do it in application, you may have to browse the messages till you get the desired sequence then do the destructive get ...
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Wed Mar 04, 2009 6:53 pm    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Is there any way to do this????
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Wed Mar 04, 2009 8:38 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

VijayGoparaju wrote:
Is there any way to do this????


Vitor wrote:

VijayGoparaju wrote:

I have a requirement, I want to delete a particular number of messages from a queue (ex: If I have 50 messages in a Queue I want to delete messages from 25 to 50).



It's a rather odd requirement. Typcially you'd flush the entire queue, or delete by date, or delete by content.

VijayGoparaju wrote:
I have checked the methods but i didnt found any.



There's nothing out of the box that will do this. If it's a one-off task you could unload the queue, delete the messages you want and reload the queue; if it's an on-going task you'll need to write an app to do it.


MQEnthu wrote:
There are many utils/supportpacks like MO71 which helps you to do this...

If you want to do it in application, you may have to browse the messages till you get the desired sequence then do the destructive get ...



_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
Toronto_MQ
PostPosted: Thu Mar 05, 2009 6:37 am    Post subject: Reply with quote

Master

Joined: 10 Jul 2002
Posts: 263
Location: read my name

To add to the other suggestions, MO03 will do this easily.

http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24009368&loc=en_US&cs=utf-8&lang=en

ie. qload -IMYQUEUE -fMYFILE -r20..30

>qload
QLOAD Program by Paul Clarke [ V1.4 Build:Mar 29 2007 ]

(c) Copyright IBM Corp. 2005, 2006

Usage: QLOAD <Optional flags as below>
[-a <File access mode for fopen()>
a Append
b Binary
[-c <CCSID>[:X'Encoding'] Convert]
[-C [A][I][a][i][d][n] Context]
A Set all context (default)
I Set identity context
a Pass all context
i Pass identity context
d Default context
n No context
[-d <Display Options>]
a Add ASCII columns to HEX file
A Write ASCII lines rather than HEX
i Write message index
T Display time on queue
[-f <File Name> or -f <stdout>]
[-F <File Name> (forcing overwrite)]
[-i <Input Queue> (Browse)]
[-I <Input Queue> (Get)]
[-l <library name> e.g.mqm or mqic32]
[-m <Queue Manager name>]
[-o <Output Queue>]
[-p Purge source queue]
[-q Quiet]
[-r <Message Range>]
x Message x only
x..y Message x to message y
x#y y messages starting at message x
#x First x messages
[-t <Transaction Message Limit>]
[-T <Time on queue (Age) selection>
[[[DD:]HH:]MM ][,[[DD:]HH:]MM]
[-s <Ascii Search String>]
[-S <Ascii Not Search String>]
[-e <Ebcdic Search String>]
[-E <Ebcdic Not Search String>]
[-w <MQGET Wait interval(seconds)]
[-x <Hex Search String>]
[-X <Hex Not Search String>]

Examples
--------
Unload a queue to a file : qload -iQ1 -fmyfile
Load a queue from a file : qload -oQ1 -fmyfile
Copy a queue from Q1 to Q2 : qload -iQ1 -oQ2
Move a queue from Q1 to Q2 : qload -IQ1 -oQ2
Move old messages from Q1 to Q2 : qload -IQ1 -oQ2 -T1440
Convert from old file to new : qload -foldfile -fnewfile -da
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 » IBM MQ API Support » Deleting a particular number of Messages from the Queue
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.