Thursday, 3 April 2014

WebSphere Messaging Engine and Stuck Messages

Hi, in this post we are going to do some house keeping to WebSphere Messaging Engine. In some cases messages got stucked in committing or removing state (IBM calls them indoubt messages). When that happens, it is impossible to manage them via administration console.

Service Integration > Buses > xyzServiceBus > Messaging Engines > abcMEBus > Queue Points > queueA > Runtime > message > delete etc...

So we need to use wsadmin.sh and some commands. I always use the wsadmin.sh under the DMGR profile. So start the wsadmin.sh and connect to DMGR, type your username and password if your cell is secure. What we need first is to get the correct message id. Use below command;

$AdminControl invoke [$AdminControl queryNames type=SIBMessagingEngine,*] getPreparedTransactions

This will give us a very long string, expect something like

!V0FTRAAAACQAAAFC72342347HesQAAAAIAAj8tAnvvXi34ge4rh5tjhe4f43e3wov5krh54i-r62ZrKqTBuEAAAAAAA2AAABQu*x3rEAAAACAAI-LQJRGDRHDRGS7714qL*ZK432fw4r2eeIv6*tmayqkwbhAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAC

Did you get such an id? Good. Now we are going to use this id in another command.

$AdminControl invoke [$AdminControl queryNames type=SIBMessagingEngine,*] commitPreparedTransaction msgid

Do not use quoation or anything just paste the message id we got from previous command as a whole instead of where I wrote msgid in italic.

This will commit any stuck messages in any state, if this does not solve your problem we have another parameter for rolling back the message.

$AdminControl invoke [$AdminControl queryNames type=SIBMessagingEngine,*] rollbackPreparedTransaction msgid

This will rollback, but I usually don't need to use it, committing manually solves almost all stuck messages.

Have a nice debugging.

1 comment: