Professional JMS

JMQ is a JMS implementation from Sun Microsystems that supports both PTP and Pub/Sub models, and is written in pure Java. JMQ is available under various "Try & Buy" deals from http://www.sun.com/workshop/jmq. There are three forms of this product available:

Product Features

JMQ provides a simple, powerful, and flexible messaging solution:

JMQ Binaries

JMQ comes with a set of binaries for running the router, administering the users, configuring Administered objects, monitoring, etc.

irouter

The irouter binary is used for routing the messages delivered by JMS applications to other JMS applications and routers. This can be found in the bin directory of the JMQ installation. The screenshot below shows an instance of JMQ router up and running:

Note 

Please refer to the JMQ deployment documentation for the different command-line options available for running the router.

irmon

This utility can be found in the bin directory of the JMQ installation and is used for monitoring the debugging information and network output. JMQ provides an exhaustive set of options for debugging and monitoring the router.

ircmd

This utility enables the users to perform administrative tasks on the router. The user can query connection information, control monitor and debug options, etc. The screenshot shows running the ircmd with the help command executed:

jmqconfig

This utility can be used for configuring and storing the JMS Administered objects. This can be used for storing, deleting, viewing, and listing the destinations and connection factories in a JNDI namespace. The jmqconfig utility provides various command-line options for specifying the type of the Administered object, the JNDI service provider, initial context factory, etc. The screenshot below shows the use of jmqconfig to store a queue named myQueue in the file system provider context at the location c:\temp:

jmqadmin

This is used for running the graphical administration console for performing the following tasks:

The utility doesn't let you delete durable topics. JMQ also provides a simple and non-encrypted client authentication server for development that can be administered using the administration console. The figure below shows the main screen for the administration console:

Running the Portable JMS Client

The topic and topic connection factory are stored in the WinNT file system context for JMQ (we could also use LDAP; see jmqconfig earlier in the appendix).

Configuring the Administered Objects

We will be storing the Administered objects under the directory C:\temp in the WinNT file system context for the Java Message Queue. The JMQ implementations for the interfaces for topic and topic connection factory can be created and stored in a JNDI namespace using the jmqconfig tool explained earlier. Run the following command to store the topic myTopic in the WinNT file system context:

"%JMQ_HOME%\bin\jmqconfig" -a -t t -n myTopic -o "name=myTopic" -i "com.sun.jndi.fscontext.RefFSContextFactory" -u "file:C:/temp"

The following command can be used for storing the topic connection factory TCFactory:

"%JMQ_HOME%\bin\jmqconfig" -a -t tf -n TCFactory -o "host=localhost" -i "com.sun.jndi.fscontext.RefFSContextFactory" -u "file:C:/temp"

Here the -o option is used to specify the host on which the message broker will be running.

Running the Client

For running the client, first start the JMQ router by running the irouter binary as explained in one of the previous sections. Now invoke the Java interpreter on the class PortableJMSClient with all the required classes in the classpath and passing the JNDI provider URL and the JNDI initial context factory as command-line arguments.

The required JAR files can all be found in the JMQ installation library:

The following command-line arguments should be passed to the program for running the client:

Important 

In Java file protocol URLs, the file separator can be forward or backward.

The screenshot below shows the JMS client running against JMQ:

Категории