How To Delete JMS Messages from a Queue with the WLST
This document describes WebLogic Scripting Tool (WLST) commands to delete messages from a JMS message queue. Sometime, you may need to delete all the messages from JMS queues. However, using the Queues > Monitoring tab in the console, you might encounter an out of memory condition. This can happen because the console tries to load the messages prior to deleting them, leading to the out of memory condition.
Solution
Run the following sequence of WLST commands, substituting your own server's information where necessary:
wls:/offline> connect('weblogic','welcome1','t3://localhost:7001')
wls:/WLST_domain/serverConfig> serverRuntime()wls:/WLST_domain/serverRuntime> cd('JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0')wls:/WLST_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0> ls()wls:/WLST_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0> cmo.deleteMessages('')
wls:/WLST_domain/serverConfig> serverRuntime()wls:/WLST_domain/serverRuntime> cd('JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0')wls:/WLST_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0> ls()wls:/WLST_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0> cmo.deleteMessages('')
1 Comments
You can use the solution from:
ReplyDeletehttp://javaheapspace.com/delete-jms-messages-from-a-queue/