Author |
Message
|
boos |
Posted: Fri Nov 04, 2022 4:22 am Post subject: removing large number of uncommitted messages from a queue |
|
|
![](images/avatars/5676297875347fcfb8d268.jpg) Apprentice
Joined: 27 Jan 2004 Posts: 36 Location: Netherlands
|
Hello,
I've got 709 uncommitted messages on a queue.
the culprit application has been stopped and there are no more handles on the queue. So MQ is patiently awaiting the confirmation of the external transaction manager (which will never come).
so there I am with 709 uncommitted messages on a queue.
When I have only a few uncom messages I use the dspmqtrn en rsvmqtrn commando's to find the trx-id and then either commit or backout individual transactions. But with 709 messages this is a bit time consuming.
I already did a rsvmqtrn -a (as -a is the only option without an individual trx-id)
I thought of deleting the queue en redefining it, but MQ won't let me because of the uncomitted messages (maybe the transactions log would become corrupt or something).
And stopping of the queuemanager would probably release the transactions (but i'm not willing to stop the entire queuemanager just for this purpose)
Seems that I should script something from the output of the dspmqtrn command and feed that into the rsvmqtrn command. Anyone already done a script like that ? (suggestions are welcome)
I did see this topic http://www.mqseries.net/phpBB/viewtopic.php?t=54058&sid=0e4e2dff328c36c059f85c971b33f941 (from2010) where Bruce2359 suggested on deleting the disc object of the queue. I'd rather not do that unless the transaction logs are released as well (which i doubt).
Are there any other options ?
kind regards
Boos |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
bruce2359 |
Posted: Fri Nov 04, 2022 6:08 am Post subject: |
|
|
![](images/avatars/58715422151eef88d5f6e3.jpg) Poobah
Joined: 05 Jan 2008 Posts: 9407 Location: US: west coast, almost. Otherwise, enroute.
|
(I’ve always known that one day my past would catch up to me.)
Other than having 709 uncommitted messages orphaned in a queue, is anyone complaining about 709 missing business transactions? If not, then is your concern one of ‘cleanliness is next to Godliness?’ _________________ 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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
boos |
Posted: Fri Nov 04, 2022 6:37 am Post subject: |
|
|
![](images/avatars/5676297875347fcfb8d268.jpg) Apprentice
Joined: 27 Jan 2004 Posts: 36 Location: Netherlands
|
> is anyone complaining about 709 missing business transactions?
They're aware of them and explicitly asked to remove them.
>If not, then is your concern one of ‘cleanliness is next to Godliness?’
partly but mostly it's the issue that the queue displays that there are 709 messages while in reality there are non (as it should be) |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
boos |
Posted: Fri Nov 04, 2022 7:46 am Post subject: |
|
|
![](images/avatars/5676297875347fcfb8d268.jpg) Apprentice
Joined: 27 Jan 2004 Posts: 36 Location: Netherlands
|
A colleague that has more excel skills than I has provided the solution
so the file I got with dspmqtrn
dspmqtrn -m {queuemanager} -q > MQtrxFile.txt
which was filtered in excel to only contains those transactions that contained the object (=queue) I had to clear. This is how it is done in excell.
paste the output in excell
delete alle space (search/replace all space by nothing)
and filter column A on 'TranNum' Or 'Object({queuename}'
get rid of the lines TranNum that don't have the Object({queuename} in the next line
and then adjust the filter on only TranNum and put the right text in front: rsvmqtrn -m {queuemanager} -b {the excell output TranNum}
Cut and paste in a file and we got a cmd file that backout those transactions that are related to the specific queue.
all my UNCOM messages are gone from the queue ![](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
bruce2359 |
Posted: Sat Nov 05, 2022 12:40 pm Post subject: |
|
|
![](images/avatars/58715422151eef88d5f6e3.jpg) Poobah
Joined: 05 Jan 2008 Posts: 9407 Location: US: west coast, almost. Otherwise, enroute.
|
Microsoft Excel to the rescue. _________________ 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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
gbaddeley |
Posted: Mon Nov 07, 2022 6:58 pm Post subject: |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_yoda.gif) Jedi Knight
Joined: 25 Mar 2003 Posts: 2501 Location: Melbourne, Australia
|
Excel? A short UNIX shell script or PowerShell script would have been appropriate. _________________ Glenn |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
|