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 » deleting single message from queue

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 deleting single message from queue « View previous topic :: View next topic » 
Author Message
jaipalreddy
PostPosted: Thu Feb 28, 2013 10:10 pm    Post subject: deleting single message from queue Reply with quote

Novice

Joined: 27 Feb 2013
Posts: 11

is there any command to delete a single message from a queue for example there are 500 messages in my queue but i want delete 250th message is it possible to do that if yes please suggest me how can we delete and command also
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Mar 01, 2013 1:19 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

MO71 SupportPac.
_________________
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
mqjeff
PostPosted: Fri Mar 01, 2013 4:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

exerk wrote:
MO71 SupportPac.


So MO71 will do exactly and only what MQ allows, which is use code to read all 250 messages on the queue using browse, and then do a destructive GET on the 250th message.
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Mar 01, 2013 5:25 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

mqjeff wrote:
exerk wrote:
MO71 SupportPac.


So MO71 will do exactly and only what MQ allows, which is use code to read all 250 messages on the queue using browse, and then do a destructive GET on the 250th message.

Or just select the 250th message, check it's the correct one, and then destructively GET it.
_________________
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
mqjeff
PostPosted: Fri Mar 01, 2013 6:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

exerk wrote:
mqjeff wrote:
exerk wrote:
MO71 SupportPac.


So MO71 will do exactly and only what MQ allows, which is use code to read all 250 messages on the queue using browse, and then do a destructive GET on the 250th message.

Or just select the 250th message, check it's the correct one, and then destructively GET it.


No.

That's what MO71 "allows" the user to do.

That's not what it actually does. In order to show you *any* messages at all, MO71 has to browse them. In order to "delete" a message, it must do a destructive GET of that message. In order to delete the 250th message, it must browse all 249 messages before the 250th, and then browse the 250th to get at least the msgid, and then do a destructive GET that matches the message ID.

The fact that it wraps that in a GUI has nothing to do with what it actually does.

The point is that any MQ application can do exactly the same things, there is absolutely nothing special about MO71 in this case. Capitalware's message editing tool can,and I'm sure roger will be along to remind everyone that it does, do exactly the same thing.
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Mar 01, 2013 6:20 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

mqjeff wrote:
exerk wrote:
mqjeff wrote:
exerk wrote:
MO71 SupportPac.


So MO71 will do exactly and only what MQ allows, which is use code to read all 250 messages on the queue using browse, and then do a destructive GET on the 250th message.

Or just select the 250th message, check it's the correct one, and then destructively GET it.


No.

That's what MO71 "allows" the user to do.

That's not what it actually does. In order to show you *any* messages at all, MO71 has to browse them. In order to "delete" a message, it must do a destructive GET of that message. In order to delete the 250th message, it must browse all 249 messages before the 250th, and then browse the 250th to get at least the msgid, and then do a destructive GET that matches the message ID.

The fact that it wraps that in a GUI has nothing to do with what it actually does.

I wasn't suggesting that it didn't - my poor phraseology - but to the user, the browse of the other messages will be 'invisible'.

mqjeff wrote:
The point is that any MQ application can do exactly the same things, there is absolutely nothing special about MO71 in this case.

True - but MO71 is ready out-of-the-box to do it without the OP having to reinvent that wheel.

mqjeff wrote:
Capitalware's message editing tool can,and I'm sure roger will be along to remind everyone that it does, do exactly the same thing.

As above...
_________________
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
mqjeff
PostPosted: Fri Mar 01, 2013 7:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

exerk wrote:
mqjeff wrote:
The point is that any MQ application can do exactly the same things, there is absolutely nothing special about MO71 in this case.

True - but MO71 is ready out-of-the-box to do it without the OP having to reinvent that wheel.

Which is really a failure in MQExplorer rather than a virtue of MO71.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Mar 01, 2013 8:11 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

One of many limitations of MQ explorer, or alternatively one of many virtues of MO71.
Back to top
View user's profile Send private message
jaipalreddy
PostPosted: Fri Mar 01, 2013 8:53 am    Post subject: Reply with quote

Novice

Joined: 27 Feb 2013
Posts: 11

so there is no command in linux platform to delete a single msg right? is there any command to delete only few messages from a queue for example i have 200 msgs in my queue but i want delete first 50 messages is it possible
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Mar 01, 2013 8:56 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

jaipalreddy wrote:
so there is no command in linux platform to delete a single msg right? is there any command to delete only few messages from a queue for example i have 200 msgs in my queue but i want delete first 50 messages is it possible


It depends on what you mean by "command".

MQGET is a command. It will remove whatever message you tell it to. It will remove one message at a time. It will do it very well.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 01, 2013 8:59 am    Post subject: Reply with quote

Grand High Poobah

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

jaipalreddy wrote:
so there is no command in linux platform to delete a single msg right? is there any command to delete only few messages from a queue for example i have 200 msgs in my queue but i want delete first 50 messages is it possible


There's no command to delete any message on any platform; at a command level all you can do is clear the entire queue.

There are many methods of reading a message destructively off a queue, and it's possible to locate and read a message which isn't the first one and all of them are at the last just exectuting a series of API calls. This thread has described a number, if you find none applicable to your situation or your chosen solution doesn't work on Linux (or your Linux) then your best bet is to knock up a few lines of code in your preferred language to achieve what you need.

Remember the amqsget, amqsbcg & amqsput "commands" are not commands, but sample code supplied with the product.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jaipalreddy
PostPosted: Fri Mar 01, 2013 9:03 am    Post subject: Reply with quote

Novice

Joined: 27 Feb 2013
Posts: 11

when application issue the MQGET call it consumes message but as an MQ administrator we can't delete the one particular msgs don't we have that authority if we have how can we delete
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Mar 01, 2013 9:07 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

jaipalreddy wrote:
when application issue the MQGET call it consumes message but as an MQ administrator we can't delete the one particular msgs don't we have that authority if we have how can we delete


By telling the application team that if they want you to do this function, they must provide you the tools to do so.

You can continue to ask for clarification on what has already been answered.

Or you can act locally to resolve the situation.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 01, 2013 9:10 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Presumambly you don't have this authority for a good reason.

So first, get the authority.

And then use a home grown app or an MQ Admin tool to destructively MQGET the first message on the queue, as often as you like. Or browse the messages in the queue one after another until you find the one you want to delete, then do a destructive get. The more sophisticated the tool, the easier and faster this will be.

MO71 makes this very easy and fast. But it still requires you have the MQ Authority to do a destructive MQGET on the queue.

There is no 'command' to delete a message.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Mar 01, 2013 9:13 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

Messages are delivered from the queue to the application in either first-in-first-out OR by FIFO within priority - depending on a queue attribute.

So, following an MQOPEN, the first MQGET will deliver the first message to the application. There is no way to consume the 2nd or 250th message explicitly.

Your app developers will need to write an app that loops MQGETs 250 times to consume the 250th message.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » General Discussion » deleting single message from 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.