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 » Trigger to delete messages?

Post new topic  Reply to topic
 Trigger to delete messages? « View previous topic :: View next topic » 
Author Message
olan022
PostPosted: Thu Sep 25, 2003 4:57 am    Post subject: Trigger to delete messages? Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

We are testing an app that drops a large number of messages to a queue. We don't need the messages so it would be ideal to simply have a trigger DELETE every message that comes to the queue. Is there a sample mqm program that can delete the message? I have also tried using a CLEAR QL() runmqsc command within the process definition but the object are in use.

Any suggestions? THanks.
Back to top
View user's profile Send private message Send e-mail
olan022
PostPosted: Thu Sep 25, 2003 5:34 am    Post subject: Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

fyi
I've tried the sample AMQSGET program to remove the messages but I get a Reason Code 2080 error:

Truncated message returned (processing not completed).
On an MQGET call, the message length was too large to fit into the supplied buffer. The MQGMO_ACCEPT_TRUNCATED_MSG option was not specified, so the message has not been removed from the queue. If this was a browse operation, the browse cursor remains where it was before this call, but if MQGMO_BROWSE_FIRST was specified, the browse cursor is positioned logically before the highest-priority message on the queue.
The DataLength field is set to the length of the message before truncation, the Buffer parameter contains as much of the message as fits, and the MQMD structure is filled in.
Corrective action: Supply a buffer that is at least as large as DataLength, or specify MQGMO_ACCEPT_TRUNCATED_MSG if not all of the message data is required.


It doesn't look like there is any way I can use these options with the standard AMQSGET program - or is there?
Back to top
View user's profile Send private message Send e-mail
Nathan
PostPosted: Thu Sep 25, 2003 5:44 am    Post subject: Reply with quote

Acolyte

Joined: 15 Sep 2003
Posts: 52
Location: Rochester, NY

If you don't mind doing the deletes manually, I would recommend getting the IH03 support pac. This is a very useful message tool. It has a clear queue function. Not to mention the many other capabilities.
Back to top
View user's profile Send private message
olan022
PostPosted: Thu Sep 25, 2003 5:53 am    Post subject: Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

Thanks for the info, but I would like to have this triggered since this application can potentially generate upwards 80,000 messages to one queue very quickly and doing this manually isn't really a viable option.
Back to top
View user's profile Send private message Send e-mail
Nathan
PostPosted: Thu Sep 25, 2003 6:02 am    Post subject: Reply with quote

Acolyte

Joined: 15 Sep 2003
Posts: 52
Location: Rochester, NY

wow, that is a lot of messages! I hope you can find a use for the IH03 tool anyway.

What OS are you trying to create the queue reader program on?
Back to top
View user's profile Send private message
olan022
PostPosted: Thu Sep 25, 2003 6:10 am    Post subject: Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

AIX 5L
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Sep 25, 2003 6:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You should simply be able to modify AMQSGET to accept truncated messages. Then it will destructively read the message, and only keep the first piece of it that fits into the buffer it supplies.

If you set that buffer to be one byte, and then modify it to read every message in the queue, you should be good.

Or there might be a program in the repository here that does this already.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Nathan
PostPosted: Thu Sep 25, 2003 6:20 am    Post subject: Reply with quote

Acolyte

Joined: 15 Sep 2003
Posts: 52
Location: Rochester, NY

I have made some PERL scripts that have the function you are trying to get. But, yes, what JeffLowrey said should work for AMQSGET.
Back to top
View user's profile Send private message
olan022
PostPosted: Thu Sep 25, 2003 6:24 am    Post subject: Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

You can do this using a MQGET call, but apparently not using an AMQSGET program. The AMQSGET program doesn't allow for those kind of options.

Now if I could program, I could write something with an MQGET with one of those options, unfortunately I don't know how to program that.
Back to top
View user's profile Send private message Send e-mail
Nathan
PostPosted: Thu Sep 25, 2003 6:37 am    Post subject: Reply with quote

Acolyte

Joined: 15 Sep 2003
Posts: 52
Location: Rochester, NY

You will probably have to change the MQGMO_DEFAULT in this line. You will have to list all the settings you need.

Code:
MQGMO   gmo = {MQGMO_DEFAULT};
Back to top
View user's profile Send private message
olan022
PostPosted: Thu Sep 25, 2003 7:40 am    Post subject: Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

I'll have to take a crack at programming this. Thanks for your help guys!
Back to top
View user's profile Send private message Send e-mail
Ratan
PostPosted: Thu Sep 25, 2003 8:39 am    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

You can use the 'Q' program which is available as a support pack to do a destructive get from the Queue. I dont remember the Support pack ID. I use it for a similar problem.
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
olan022
PostPosted: Thu Sep 25, 2003 9:15 am    Post subject: Reply with quote

Acolyte

Joined: 17 Apr 2002
Posts: 50

Looks to be SupportPac MA01. I'll take a look - thanks!

http://www-3.ibm.com/software/integration/support/supportpacs/individual/ma01.html
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Trigger to delete 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.