Friday, August 24, 2012

This Post 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.

Run the following sequence of WLST commands, substitute your own server's information where necessary:

Steps to delete messages from JMS queue using WLST

Go To

  $MIDDLEWARE_HOME /user_projects/domains/yourdomain/bin

 $MIDDLEWARE_HOME /user_projects/domains/yourdomain/bin>setDomainEnv.cmd

$MIDDLEWARE_HOME /user_projects/domains/yourdomain> java weblogic.WLST

wls:/offline> connect('weblogic','welcome1','t3://localhost:8001')

Since your JMS Queue targeted to SOA server, so you need to use soa server port in above command. If you will connect by Admin port (7001) then you would not able to delete messages from jms queue which is targeted on soa server. 

wls:/WLST_domain/serverConfig> serverRuntime()

 wls:/WLST_domain/serverRuntime> cd('JMSRuntime/soa_server1.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0')

soa_server1.jms : is your server to which JMS queue resides. In my case it is soa_server1.
JMSServer-0: is your JMSServer that you are using to create JMS queue. In my case it is SOAJMSServer.
SystemModule-0 : is your JMS Module. In my case it SOAJMSModule.
Queue-0: is the jms queue from that you want to delete messages. In my case it is RequestQueue.

wls:/WLST_domain/serverRuntime>  cd('JMSRuntime/soa_server1.jms/JMSServers/SOAJMSServer/Destinations/SOAJMSModule!RequestQueue')

wls:/WLST_domain/serverRuntime/JMSRuntime/soa_server1.jms/ SOAJMSServer/Destinations/SOAJMSModule!RequestQueue> ls()

wls:/WLST_domain/serverRuntime/JMSRuntime/soa_server1.jms/JMSServers/ SOAJMSServer/Destinations/SOAJMSModule!RequestQueue> cmo.deleteMessages('')


Post a Comment