Author |
Message
|
guest468 |
Posted: Mon Aug 04, 2008 7:34 am Post subject: Clearing get disabled queue |
|
|
Centurion
Joined: 30 May 2006 Posts: 146 Location: NY
|
Hi,
I was trying to clear a queue using 'clear ql' command but actually the queue was get disabled but still I could clear it successfully. So wondering how it worked? It looks like it is not using MQGET MQI call?
Thanks |
|
Back to top |
|
 |
Gaya3 |
Posted: Mon Aug 04, 2008 8:05 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
there are 2 ways of clearing:
one is by using MQGET and another by CLEAR MQSC command
if you use CLEAR command, it does/clear it, though it is GET Disabled.
but if you try MQGET , it will prompt an error. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
Gaya3 |
Posted: Mon Aug 04, 2008 8:07 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
Extract from docs:
Quote: |
If you use the CLEAR command, all of the messages are cleared from the queue. However, if the queue is already opened exclusively by another application or if the queue contains uncommitted messages, the command fails immediately and none of the messages are cleared.
If you use the MQGET API call, the messages are got from the queue until no more messages are available. However, MQGET does not recognize uncommitted messages, which means that there could still be uncommitted messages on the queue. Also, the command might fail if the queue is already exclusively opened by another application |
_________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Aug 04, 2008 8:11 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
yes it does not...
infact if you see the v6 MQExplorer.. while clearing the messages you get two options
1) using clear command and 2) using MQGET..
so its quite implicit that CLEAR command does not use MQGET internally... _________________ Cheers |
|
Back to top |
|
 |
zpat |
Posted: Mon Aug 04, 2008 11:31 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you want to remove messages from a queue with MQGET, you can get disable in alias queue for the application and use another alias (or the underlying local queue) to remove messages. |
|
Back to top |
|
 |
sami.stormrage |
Posted: Mon Aug 04, 2008 11:55 pm Post subject: |
|
|
 Disciple
Joined: 25 Jun 2008 Posts: 186 Location: Bangalore/Singapore
|
@above
Wow.. :O that was a really great piece of info. I tot aliases could be used for bypassing security apart from their normal task. _________________ *forgetting everything * |
|
Back to top |
|
 |
guest468 |
Posted: Thu Aug 07, 2008 7:36 am Post subject: |
|
|
Centurion
Joined: 30 May 2006 Posts: 146 Location: NY
|
Thanks guys for the info.
Actually I was trying to figure out what CLEAR command does internally if not MQGET. Does it directly manipulate the queue file in some way?
Actually I am trying to figure out if it is possible to simulate this command from MQ program or so and clear it even if there is an open handle.
Thanks. |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Aug 07, 2008 4:26 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
CLEAR QLOCAL must be used with caution on queues which have queue depth events enabled.
If the queue depth low event is enabled, the event will not be generated if the queue depth decreases through the low depth threshold on its way to zero. If the queue depth full event had previously occurred this will leave the queue depth high event disabled. This could lead to the situation where the queue depth could later increase to the point of the queue being full, but the queue depth high event would not have occurred along the way. _________________ Glenn |
|
Back to top |
|
 |
markt |
Posted: Thu Aug 07, 2008 5:33 pm Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
Quote: |
if the queue depth low event is enabled, the event will not be generated |
not true since V6 - CLEAR generates same events as if you'd done mutiple MQGETs. |
|
Back to top |
|
 |
AkankshA |
Posted: Fri Aug 08, 2008 3:42 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
markt wrote: |
Quote: |
if the queue depth low event is enabled, the event will not be generated |
not true since V6 - CLEAR generates same events as if you'd done mutiple MQGETs. |
hmm... IIRC Clear option was added in v6 only..  _________________ Cheers |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Aug 08, 2008 3:52 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Aug 08, 2008 4:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Also, it is best if you assume that everything posted by markt is correct. |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Aug 10, 2008 8:01 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
markt wrote: |
Quote: |
if the queue depth low event is enabled, the event will not be generated |
not true since V6 - CLEAR generates same events as if you'd done mutiple MQGETs. |
ok. My test was under MQ 5.3 about 4 years ago. I just retested on MQ 7.0 and it does generate queue depth low events on CLEAR QLOCAL. It must have been fixed since then! My apologies. _________________ Glenn |
|
Back to top |
|
 |
|