IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Deleting messages from Reply queue


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
veeruspi

New User


Joined: 29 Dec 2005
Posts: 16
Location: mysore

PostPosted: Mon May 30, 2011 12:00 pm
Reply with quote

Hi All,

I have a requirement to delete the messages from reply queue. I need to check if the message put time is 15 mins prior to current time, I need to delete those messages. For ex. if there are 5 messages out of which 3 have arrived after 11 AM and 2 messages before 11 AM. If current time is 11.15AM, then I have to dlete the 2 messages which have arrived before 11AM. How can I do this?

Thanks
Veeru
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 30, 2011 1:40 pm
Reply with quote

This is a strange requirement.

Typically, the application which MQPUT(1)s the reply message would specify an expiry interval in the MQMD of the reply message. Once this expiry interval has elapsed, MQ will flag the message as unavailable and MQ's housekeeping will take care of deleting it.

Otherwise, your application processing the reply queue needs to MQGET every message (specify MQMI-NONE and MQCI_NONE) and check the MQMD.PutTime against the current time. Doing this, you then probably need some mechanism to correlate the replies that you will not simply delete with the corresponding request messages.

I'd rethink the application design to use MQ facilities.

Garry.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue May 31, 2011 3:43 am
Reply with quote

See the manual

Pay particular attention to the sections labeled

"Removing a message that you have browsed" (note: a "normal" Browse is NON-destructive) and

"Browsing messages when the message length is unknown" (note: why read the entire message into a buffer when you aren't really going to look at its contents?)

under the section labeled

"Browsing messages on a queue"

You may have to follow the links to find the proper MQOPEN options, etc.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Deleting a Tape file JCL & VSAM 14
No new posts MQ response when MQGET of a stopped q... Java & MQSeries 2
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts IOF Output Queue & REXX(?) All Other Mainframe Topics 2
No new posts REXX GETMSG does not return £HASP880... CLIST & REXX 2
Search our Forums:

Back to Top