Testing the JMS class path

You can use the example program examples.jms.MQeJMSIVT to test your JMS installation. Before you run this program, you need an MQe queue manager that has a SYSTEM.DEFAULT.LOCAL.QUEUE. In addition to the JMS jar files mentioned above, you also need the following or equivalent jar files on your class path to run examples.jms.MQeJMSIVT:
  • MQeBase.jar
  • MQeExamples.jar
You can run the example from the command line by typing:
  java examples.jms.MQeJMSIVT -i
    <ini file name>
where <ini file name> is the name of the initialization (ini) file for the MQe queue manager. You can optionally add a "-t" flag to turn tracing on:
java examples.jms.MQeJMSIVT -t -i
    <ini file name>
The example program checks that the required jar files are on the class path by checking for classes that they contain. It creates a QueueConnectionFactory and configures it using the ini file name that you passed in on the command line. It starts a connection, which:
  1. Starts the MQe queue manager
  2. Creates a JMS Queue representing the queue SYSTEM.DEFAULT.LOCAL.QUEUE on the queue manager
  3. Sends a message to the JMS Queue
  4. Reads the message back and compares it to the message it sent
The SYSTEM.DEFAULT.LOCAL.QUEUE should not contain any messages before running the program, otherwise the message read back will not be the one that the program sent. The output from the program should look like this:
using ini file '<.ini file name>'
    to configure the connection
checking classpath
found JMS interface classes
found MQe JMS classes
found MQe base classes
Creating and configuring QueueConnectionFactory
Creating connection
From the connection data, JMS 
  provider is IBM MQe Version 2.0.0.0
Creating session
Creating queue
Creating sender
Creating receiver
Creating message
Sending message
Receiving message


HEADER FIELDS
----------------------------------------
 JMSType:          jms_text
 JMSDeliveryMode:  2
 JMSExpiration:    0
 JMSPriority:      4
 JMSMessageID:     ID:00000009524cf094000000f052fc06ca
 JMSTimestamp:     1032184399562
 JMSCorrelationID: null
 JMSDestination:   null:SYSTEM.DEFAULT.LOCAL.QUEUE
 JMSReplyTo:       null
 JMSRedelivered:   false

 PROPERTY FIELDS (read only)
-----------------------------------------
 JMSXRcvTimestamp : 1032184400133

 MESSAGE BODY (read only)
-----------------------------------------
A simple text message from the MQeJMSIVT program

Retrieved message is a TextMessage; now checking
for equality with the sent message
Messages are equal. Great!
Closing connection
connection closed
IVT finished

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.