There is a built-in utility to browse/move/delete(drain) messages from JMS queues and topics inside OracleAS OC4J. Starting of the utility has changed a little bit from version 10.1.2 but the usage is the same.
For those that want the fast way of starting up this utility, here is a sample Windows command file:
Create a new file, e.g. called JMSUtils.cmd and the contents:
@REM This script will launch OracleAS OC4J 10.1.3. JMS command line utility
@REM 4.6.2008 Harri Kaukovuo, Oracle Finland Oy
@java com.evermind.server.jms.JMSServerUtils -username oc4jadmin -password yourpassword -port 12601 %*
You need to replace the value for J2EE_HOME to point to your OracleAS OC4J home directory. By default this utility points to the local host, but you need to connect remote OC4J please add extra "-host myhost.com" as startup uption. To determine the right JMS server port, please see the following chapter.
Determing JMS server port
Depending on the installation (SOA Suite basic, advanced, WebCenter, standalone OC4J), the JMS server setting might be different. One of the easiest way to determine this when running a real OracleAS installation is to use OPMN command line tool:
opmnctl status -fmt %por
Processes in Instance: soasuite.hkaukovu-fi
As you can see, the JMS server port among others is reported as an output. You should use the jms:XXXX value in the JMSUtils.cmd command script as -port option.
opmnctl is found under $ORACLE_HOME/opmn/bin.
If you are running standalone OC4J (not installed using Oracle Universal Installer), you should look for $OC4J_HOME/j2ee/home/config/jms.xml file. The entry
will show you the port number.
In the above sample the "home" in the path $OC4J_HOME/j2ee/home/config points to the default OC4J instance name "home". In case you have multiple OC4J instances you might be different subdirectories for each instance (like oc4j_soa etc).
Please be aware that if you use OPMN to control the instance, the value in jms.xml will be overriden by OPMN driven values derived from opmn.xml "<port id="jms" range="12601-12700"/>".