May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

clean messaging queue using jython

Objective for yesterday: Clean Persistent messages from JMS queue.

There are few methods that will work depending on your messaging set-up. I ill show how to clean persistent messages from the queue using wsadmin and jython.

First of all localize wsadmin tool on your host. It is located in /AppServer/bin

cd /AppServer/bin

Create new file called cleanJMSQueue.py on your host machine with the following content. [Remember to replace variables with appropriate values matching your environment]

objName = AdminControl.makeObjectName(‘WebSphere:type=SIBQueuePoint,SIBMessagingEngine=MyNode.MyServer-MyBus,name=MyQueueName,*’)
qps = AdminControl.queryNames_jmx(objName, None)
qp = qps[0]
AdminControl.invoke_jmx(qp, ‘deleteAllQueuedMessages’, [java.lang.Boolean(‘false’)], [‘java.lang.Boolean’])

Start wsadmin tool to connect to deployment manager and execute script

wsadmin.sh -host -port -conntype SOAP -username -password -lang jython -f

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>