Actually the MQPUT may be dangerous if an application doing generic MQGETS
is running against the queue. Getting a specific message with a
non-existent MsgId and CorrelId should work, but to make it safer it needs
to do an MQBACK if a message is actually retrieved.
Regards
Tim A
"Potkay, Peter M
(PLC, IT)" To: [EMAIL PROTECTED]
<[EMAIL PROTECTED] cc:
RTFORD.COM> Subject: Re: Expiration Question
Sent by: MQSeries
List
<[EMAIL PROTECTED]
AC.AT>
12/03/2003 07:03
Please respond to
MQSeries List
Roger,
If the message with a CorrelId of "PGMNAME: Your dummy msg" is not
present, the app will simply go all the way thru the queue anyway, deleting
expired messages as it goes along. Isn't the put of the 1 byte message
unnecessary (not that it hurts anything; just extra)?
Peter Potkay
IBM MQSeries Certified
[EMAIL PROTECTED]
X 77906
-----Original Message-----
From: Roger Lacroix [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 4:16 PM
To: [EMAIL PROTECTED]
Subject: Re: Expiration Question
Hi,
Some of the platforms (i.e. OS/390) will not remove an expired message
doing
a
browse. So, I wrote a general purpose (multi-platform) C that did the
following:
- MQCONN
- MQOPEN Q for input & output
- MQPUT a 1 byte message with the following CorrelID "PGMNAME: Your dummy
msg"
- Do While RC equals 0
- MQGET by CorrelID of "PGMNAME: Your dummy msg"
- End While
- MQCLOSE Q
- MQDISC
The ONLY thing that you need to do is make sure your dummy CorrelID is
totally
unique.
I have found for cleaning up expired messages on different platforms that
putting a message with a dummy CorrelID and then doing a destructive MQGET
works every time.
later
Roger...
Quoting Jim Ford <[EMAIL PROTECTED]>:
> We've got a 'reaper' utility that we run on Solaris to take caus expired
> messages to be deleted from the queues. The utility (a Perl script)
simply
> browses through the specified queue. It accepts truncated messages, and
> uses a buffer length of 0.
>
> We've found, though, that expired messages aren't always removed. For
> example, there's one queue that gets about 20,000 messages per day, each
> with a three day expiration. When we run the expire utility in the
morning,
> we'd expect to see 20,000 messages go away on average. But it turns out
> that we were deleting just 3,000 or so, and none on some days. Eventually
> (yesterday) we hit MAXDEPTH on the queue, which was 500,000.
>
> At that time I did some investigating. I ran the utility by hand, and I
did
> some amqsbcg's againt the queue. Suddenly the queue manager decided to
> delete about 450,000 expired messages. These are persistent messages, so
> the logs were totally busy logging their deletion. That took 5 minutes
and
> the queue manager couldn't do anything else during this time.
>
> So I obviously don't fully understand the expiration process. Why doesn't
> our utility do what we expect it to do? And... what do you think I did
> yesterday that finally caused the bulk of these messages to be deleted? I
> want to make sure I don't do it again on 1st shift!
>
> Instructions for managing your mailing list subscription are provided in
> the Listserv General Users Guide available at http://www.lsoft.com
> Archive: http://vm.akh-wien.ac.at/MQSeries.archive
>
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive
This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. If
you are not the intended recipient, please notify the sender
immediately by return email and delete this communication and destroy all
copies.
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive