Author |
Message
|
TheDude |
Posted: Mon Feb 24, 2003 12:14 pm Post subject: Cannot delete messages from a local queue. |
|
|
 Apprentice
Joined: 21 Oct 2002 Posts: 31
|
If messages build-up on a reply queue I should be able to issue the clear command to delete those messages from the queue. However, this is not the case because I get the following message:
AMQ8148 Object in use.
I am using MQ 5.2 Server on Win2K with a Java servlet (MQ Java not JMS)driving the transactions. I am closing the queues and committing the transactions in the code so I don't understand what is going on.
Thx in advance |
|
Back to top |
|
 |
mqonnet |
Posted: Mon Feb 24, 2003 12:24 pm Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
Check the ip/op procs to see if there are any openers to the queue. Which may or may not be your java servlet.
You sure that you committed all the transactions and closed the queues.
Cheers.
Kumar _________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
meekings |
Posted: Tue Mar 04, 2003 4:36 pm Post subject: |
|
|
 Voyager
Joined: 28 Jun 2001 Posts: 86 Location: UK, South West
|
If you inhibit get/put on the queue, and then re-enable it, this should cause the app that has the queue open to relinquish it so you can clear. Just be careful that whoever's attached doesn't get a contact admin surprise! |
|
Back to top |
|
 |
tillywern |
Posted: Wed Mar 19, 2003 3:07 pm Post subject: |
|
|
 Centurion
Joined: 28 Jan 2003 Posts: 109 Location: Colorado
|
The command to empty a queue is disabled whenever ipprocs or opprocs (an application has the queue open of input or output).
Create a program that will delete the messages by running as an application. Just discard the results....
The easiest way to do this is to modify the amqsbcg.c or amqsget.c samples provided with the product. The only thing you will probably have to change with amqsget.c is the max message size. Amqsbcg.c browses messages so it would have to be modified more significantly.
It is well worthwhile to create a generic queue loader, unloader and browser. This way you can always work with queues directly. Eventually it allows for automated testing.
One hitch to this approach is that if the queue is opened for input with an exclusive setting you will get an error message that tells you more than one process may not have the queue open of input.
Hope this helps |
|
Back to top |
|
 |
JohnMN |
Posted: Thu Mar 20, 2003 8:42 am Post subject: |
|
|
Novice
Joined: 26 Feb 2003 Posts: 19
|
One slight change to what tillywern suggests: If you are deleting the messages anyway, allocate a very small buffer and set
MQGMO.Options=MQGMO_ACCEPT_TRUNCATED_MSG
You'll get RC=2079, but the message will be removed from the queue. |
|
Back to top |
|
 |
HugoB |
Posted: Tue Mar 25, 2003 7:26 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 67
|
the command amqstrg can do miracle too !!! |
|
Back to top |
|
 |
bduncan |
Posted: Tue Mar 25, 2003 10:20 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
amqsbcg will only work if all the messages on the queue are expired. Then the act of simply browsing them will cause them to be removed from the queue. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
Ratan |
Posted: Tue Mar 25, 2003 11:19 am Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
I use the 'q' program to do a distructive get to clear the queues with non zero ipprocs/opprocs. I like it. Dont remember the support pac in which it is available.
-Laze |
|
Back to top |
|
 |
|