Author |
Message
|
bduncan |
Posted: Thu May 17, 2001 9:48 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Especially when I'm testing, I find it necessary to constantly clear queues that I am working with. The problem is that sometimes when a program has opened the queue and done PUTs or GETs, it will show up as an IPPROC or OPPROC (you can see this parameter by issuing a DIS QL(queuename) command) and whenever either of these values are greater than 0, you can't clear the queue. What constantly irks me is that when the program finishes and does the close and disconnect, the IPPROC or OPPROC doesn't immediately go away, and so I have to wait a few minutes before I can clear the queue. A workaround is to get the messages off the queue manually. The amqsget program that comes with MQSeries would do the trick, but unfortunately its buffer size is such that it can only get the smallest of messages off the queue. This can easily be remedied by taking the amqsget source code (also part of the MQSeries distribution) and changing the buffer size to the max message size - 2Mb. Recompile, and run it against a queue and you will effectively clear it off even if there are IPPROCs or OPPROCs.
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu May 17, 2001 8:18 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
You meant 4MB (or 4194304) right?
later
Roger... |
|
Back to top |
|
 |
jsware |
Posted: Thu May 17, 2001 11:39 pm Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
Another way to do it is to put/get inhibit then enabled the queue (i.e. change it to inhibit and then back again) and then clear the queue. Might be faster if you have 1000s of messages.... |
|
Back to top |
|
 |
bduncan |
Posted: Fri May 18, 2001 8:38 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Roger - I was just making sure people were paying attention
Looks like you get the cookie. Where should I mail it to? hehehe
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
thayzz |
Posted: Mon Jun 25, 2001 9:53 am Post subject: |
|
|
Newbie
Joined: 24 Jun 2001 Posts: 1
|
I took the amqsget source, reduced the buffer down to 1 byte, added MQGMO_ACCEPT_TRUNCATED_MSG, and removed the printf statements. I call this 'clearq'. |
|
Back to top |
|
 |
HugoB |
Posted: Wed Jun 27, 2001 4:45 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 67
|
How about amqstrg
I guess this will do the trick too for
non coders !
Maybe not all the time the best solution.
|
|
Back to top |
|
 |
middlewareonline |
Posted: Wed Nov 28, 2001 2:17 pm Post subject: |
|
|
Acolyte
Joined: 09 Jul 2001 Posts: 73
|
You can alter the queues, set IPPROCS/OPPROCS to (0) and clear the queue. You force that there is NOTHING attached to the queue.
Rajesh
MiddlewareOnline.COM
_________________ ---------------------------------------------
IBM & SUN (J2EE) Certified Consultants,
http://www.MiddlewareOnline.com
A "SARVAM" Online Portal
http://www.SARVAM.com
--------------------------------------------- |
|
Back to top |
|
 |
dgolding |
Posted: Thu Nov 29, 2001 12:47 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
Sorry, but (AFAIK) you can NOT alter IPPROC and OPPROC - these are maintained by the Queue manager as processes open and close queues. And if you forcibly disconnect a process (kill -9 in the unix world) it will take some time before the clean-up is done and MQ recognises the fact that you've gone...
[ This Message was edited by: dgolding on 2001-11-29 00:47 ] |
|
Back to top |
|
 |
middlewareonline |
Posted: Mon Dec 03, 2001 12:59 pm Post subject: |
|
|
Acolyte
Joined: 09 Jul 2001 Posts: 73
|
The trick had to do with how you can clear a queue, NOT how long the queue manager will take to clean-up the process. I suggested a way to quickley get moving (sometimes required).
Rajesh
MiddlewareOnline.COM |
|
Back to top |
|
 |
anantha |
Posted: Thu Feb 28, 2002 9:45 am Post subject: |
|
|
Newbie
Joined: 04 Sep 2001 Posts: 7
|
I have tried in vain to clear a local queue where IPPROCS is 1. First I have disabled PUT and enabled and cleared the queue. I have also tried by disabling
GET and enabling it. In all cases, I could not clear the queue. It keeps on giving the mesage 'object in use'.
Then I have tried the other option ALTER. First of all, IPPROCS can't be changed with ALTER even with FORCE. So, I am unsucessful in both ways. Why?
Now, please let me know whether my friends who suggested the above options, have really tried them successfully. If so, am I missing some thing? Please guide me. I am working on MQ5.2 on Solaris 2.6.
Thanks Anantha |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Feb 28, 2002 10:48 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If the queue you are clearing (trying to anyway!) is a local queue that is being put to from a remote application, then the app that has the queue open is the receiving MCA. Stop the channel, or wait till it goes inactive, and the MCA will remove it's grubby little paws from the queue.
If the queue is input to an MQSI message flow, you will have to stop the message flow to get rid of that hook (although I would think it weird for the queue to have any messages in the queue if the flow is up.)
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
anantha |
Posted: Thu Feb 28, 2002 11:10 am Post subject: |
|
|
Newbie
Joined: 04 Sep 2001 Posts: 7
|
Thanks for your prompt reply. In my case, it is the MQSeries client that puts and gets messages on the queues reside on server. Once I stopped the SVRCONN channel, the IPPROCS is automatically reset to zero and I could clear the queue. But this is done at the cost of impact to clients. I wish to know whether the options suggested (altering IPPROCS or inhibiting PUT and GET parameters) above have been really tried or they are simply theoritical possibilities as both the optons have not worked in my case.
Thanks Anantha |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Feb 28, 2002 1:05 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Altering IPROCS yourself is not possible.
Inhibiting the queue works usually if the app that has it open has an outstanding GET with wait on the queue. Their Get will fail with a RC that tells them the queue is inhibited. I have done this. Now if you got an app that opens the queue and then watches the grass grow or something instead of putting/getting to the queue and closing, well, you got a problem. Note that the MCA does this because it doesn't know when another message might come down the channel, so it keeps it open. I'm afraid in the Client mode you are stuck with this.
I suppose you could also stop the queue manager, and then any calls should end if the apps are coded properly to Fail-If-Quiescing. But this option, or inhibiting the queue, or stopping the channel all will affect the app.
Your only other choice is to get some other app to connect to the queue and then clear it by doing destructive gets. Indeed, this is what we ended up doing ourselves, since this problem arises every so often and we would like to clear (I guess a better word would be drain) the queue.
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
sskutel |
Posted: Mon Mar 04, 2002 10:33 am Post subject: |
|
|
Newbie
Joined: 03 Mar 2002 Posts: 5 Location: Worcester, MA
|
Maybe I am missing something on this thread, but doesn't Support Pac IH03 with the "Purge" button accomplish this for you? I have also written a Queue Purge program that will purge all queues that I put in a list, single queues or a specified number of messages in a queue. It is written in VB and comes in extremely helpful during testing when I need to clear out my "test" queues. But in most cases, IH03 is sufficient. |
|
Back to top |
|
 |
cvshiva |
Posted: Tue Mar 05, 2002 6:09 am Post subject: |
|
|
 Apprentice
Joined: 04 Mar 2002 Posts: 35 Location: Chennai
|
Hi,
I also initially faced problems in clearing the queues when IPPROCS/OPPROCS >0.
I wrote a simple C Program which uses MQI to Get ( Destructive) Messages in the queue. Needing more features like copying/moving the messages between queues etc. I downloaded a SupportPac Called the "Q" Program ( available for NT, Solaris, HP UX , AIX , OS/2 ) written by Paul Clarke. It is a fantastic utility which has a lot of options which come very handy. Check it out it will certainly be useful.
For a guy like me in Administration/Support of MQSeries in the Production Environment, it is a must
_________________ Ramnath Shiva
IBM Certified SOA Specialist
IBM Certified MQSeries Specialist
Standard Scope International Pvt Ltd , Chennai |
|
Back to top |
|
 |
|