Author |
Message
|
MABeatty1978 |
Posted: Tue Nov 22, 2016 5:44 am Post subject: Clearing an uncommited message in a queue |
|
|
Acolyte
Joined: 17 Jul 2014 Posts: 54
|
Somehow or another I have a message in a queue, currdepth=1. I have a function that checks the dept and if > 0, does a get on all messages and discards them. However, I'm getting an mqrc 2033 when I try to get this messages. Looking at the three options from the MQ documentation, all this could be is that the message was never committed, which is fine, I don't need/want the message anyway. So how do I get rid of it? |
|
Back to top |
|
 |
exerk |
Posted: Tue Nov 22, 2016 6:03 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Find the application that's putting it there and not committing, and get it to commit? Alternatively, find the open handle and close it? Just a couple of considerations, pebbles in the pond so to speak.  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
PaulClarke |
Posted: Tue Nov 22, 2016 3:10 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
I guess the most likely it is a local transaction so looking for applications that have the queue open might help. However, you can close the queue and still have uncommitted messages against it so it won't necessarily help. Of course is could be a global transaction so you could try issuing dspmqtrn to see whether there are any results.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Nov 22, 2016 3:27 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Quote: |
I have a function that checks the dept and if > 0 |
In general, consuming apps should not use this logic (you have already found one shortcoming of this). The app should loop on getting messages, until there are none available.
Do you have any justification for checking the depth? _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Nov 22, 2016 3:59 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
This has been discussed here at length: CURDEPTH includes consumable messages, non-consumable messages (in syncpoint, but not yet committed), expired messages. So, it is possible that you app will receive r/c 2033 (no message available) with CURDEPTH > 0. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
exerk |
Posted: Wed Nov 23, 2016 3:30 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
PaulClarke wrote: |
...However, you can close the queue and still have uncommitted messages against it so it won't necessarily help... |
Would not a hard 'administrative' close of the open handle cause a roll-back in the application or commit? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
zpat |
Posted: Wed Nov 23, 2016 3:41 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
exerk wrote: |
Would not a hard 'administrative' close of the open handle cause a roll-back in the application or commit? |
What command would that be? _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
exerk |
Posted: Wed Nov 23, 2016 4:00 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
zpat wrote: |
exerk wrote: |
Would not a hard 'administrative' close of the open handle cause a roll-back in the application or commit? |
What command would that be? |
STOP CONN, which strictly speaking is going to do the job of closing the open handle... _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Nov 23, 2016 8:21 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
|
Back to top |
|
 |
|