5. Ultra Messaging JMS Quick Start

UMQ also includes a Ultra Messaging JMS evaluation package. You can run pre-compiled commands from an Ultra Messaging JMS distribution to get some quick performance numbers in your environment. (A subsequent section guides you through creation of simple programs for local compilation.)

Important: The application demonstrations described below assume that you will use a single machine. If you plan to test multiple machines communicating with each other, the machines will need multicast connectivity between them. Contact your network administrator for information on multicast connectivity.

An Ultra Messaging JMS evaluation package includes the following.

The Ultra Messaging JMS code and documentation are copyrighted and confidential information owned by Informatica Corporation and are covered under the terms of our Software License Agreement or Non-Disclosure Agreement as appropriate. Use of this code and documentation without a valid Non-Disclosure Agreement or Software License Agreement with Informatica, Inc. is strictly prohibited. If this code and documentation is being supplied under the terms of a Non Disclosure Agreement, all copies, in any form, must be returned or destroyed at the end of the evaluation period or as requested by Informatica Corporation.

Note: For Windows installations, you must also install the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update, which is available on the download page and contains runtime components of the Visual C++ Libraries.

Note: The Ultra Messaging JMS JAR installation is not compatible with Microsoft® Windows® due to a new dependency on libeay32.dll. As a workaround, set use_native_loader=false and load the dependencies from the PATH.

5.1. Configure Your Environment to Run Ultra Messaging JMS Examples

5.1.1. Configure Ultra Messaging JMS for Unix

Perform the following steps to configure Ultra Messaging JMS for a Unix environment.

  1. Edit the bin/env.sh file to configure your environment. You must set the following two variables.

    export JAVA_HOME="/usr/local/jdk1.6.0_16"
    export LBM_LICENSE_FILENAME=/home/user/lbm.lic
               
    
  2. Run startJMS.sh. You can now run any of the example applications with the appropriate script. See Microsoft Windows or Unix.

    Note: If you make any changes to the config.xml file to test different aspects of Ultra Messaging JMS, you must re-run the "config.sh" script. This re-creates a .bindings file from the config.xml file that all example programs use.

5.1.2. Configure Ultra Messaging JMS for Microsoft® Windows®

The following steps assume that Microsoft Windows is installed in the standard place.

Note: It is critical that you set the Microsoft Windows PATH environment variable to include the location of the UMQ product installation bin directory. In particular, iconv.dll from the bin directory must be in the executable's dll search path at runtime.

  1. Set the following three environment variables.

    set JAVA_HOME=C:\Program Files\Java\jdk1.6
    set JAVA_BIN=%JAVA_HOME%\bin
    set LBM_LICENSE_FILENAME=C:\lbm.lic
               
    

    Note: Your Java directory may be different, such as jre6. Also, your license file path or name may vary.

  2. Run startJMS.bat. You can now run any of the example applications with the appropriate script.

    Note: If you make any changes to the config.xml file to test different aspects of Ultra Messaging JMS, you must re-run the "config.bat" script. This re-creates a .bindings file from the config.xml file that all example programs use.

5.2. Microsoft Windows or Unix

All source for the following example applications is Java.

5.3. Demonstrating Request/Reply

Follow the steps below to demonstrate Ultra Messaging JMS request/reply. This demonstration uses Reply.java and Request.java source files and requires a UME server.

  1. Open a command prompt window and enter the command reply.sh or reply.bat for Microsoft Windows.

  2. Open a second command prompt window and enter the command request.sh or request.bat for Microsoft Windows.

  3. You will see output that indicates the message has been sent back and forth. Press Ctrl-C to kill either application.

5.4. Demonstrating Synch and Async Reads

Follow the steps below to demonstrate Ultra Messaging JMS synchronous and asynchronous message delivery. This demonstration uses AsyncConsumer.java, Producer.java and SyncConsumer.java source files.

  1. Open a command prompt window and enter the command AsyncConsumer.sh or AsyncConsumer.bat for Microsoft Windows.

  2. Open a second command prompt window and enter the command Producer.sh or Producer.bat for Microsoft Windows.

  3. Open a third command prompt window and enter the command SyncConsumer.sh or SyncConsumer.bat for Microsoft Windows.

For the Producer, you will see output similar to the following.

Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
Sent ********* This is a test *********** 
   

For the AsyncConsumer and the SyncConsumer, you will see output similar to the following.

Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test ***********
Received message: ********* This is a test *********** 
   

Press Ctrl-C to kill any application.

5.5. Demonstrating A Durable Consumer

Follow the steps below to demonstrate Ultra Messaging JMS durable consumer messaging. This demonstration uses DurableConsumer.java and DurableProducer.java source files and requires a UME server.

  1. Open a command prompt window and enter the command DurableConsumer.sh or DurableConsumer.bat for Microsoft Windows.

  2. Open a second command prompt window and enter the command DurableProducer.sh or DurableProducer.bat for Microsoft Windows. The DurableProducer sends 20 messages.

  3. In the command prompt window for the DurableConsumer, you should see output similar to the following.

    Reading message: This is message 1
    Reading message: This is message 2
    Reading message: This is message 3
    Reading message: This is message 4
    Reading message: This is message 5
    Reading message: This is message 6
    Reading message: This is message 7
    Reading message: This is message 8
       
    
  4. After message 8, press Ctrl-C to kill the DurableConsumer. Then restart the consumer. The remaining 12 messages sent by the DurableProducer appear in the window.

    Reading message: This is message 9
    Reading message: This is message 10
    Reading message: This is message 11
    Reading message: This is message 12
    Reading message: This is message 13
    Reading message: This is message 14
    Reading message: This is message 15
    Reading message: This is message 16
    Reading message: This is message 17
    Reading message: This is message 18
    Reading message: This is message 19
    Reading message: This is message 20
       
    

5.6. Demonstrating UMQ

Follow the steps below to demonstrate Ultra Messaging JMS queuing. This demonstration uses QueueReceiver.java and QueueSender.java.java source files and requires a UMQ server.

  1. Open two command prompt windows and in each window, enter the command QueueReceiver.sh or QueueReceiver.bat for Microsoft Windows.

  2. Open a third command prompt window and enter the command QueueSender.sh or QueueSender.bat for Microsoft Windows. The QueueSender sends 15 messages; odd numbered messages go to the QueueReceiver in Window 1 and even numbered messages to QueueReceiver in Window 2.

    Output for QueueReceiver in Window 1.

    Reading message: This is message 1
    Reading message: This is message 3
    Reading message: This is message 5
    Reading message: This is message 7
    Reading message: This is message 9
    Reading message: This is message 11
    Reading message: This is message 13
    Reading message: This is message 15
       
    

    Output for QueueReceiver in Window 2.

    Reading message: This is message 2
    Reading message: This is message 4
    Reading message: This is message 6
    Reading message: This is message 8
    Reading message: This is message 10
    Reading message: This is message 12
    Reading message: This is message 14 
       
    

Press Ctrl-C to kill any application.

5.7. Other Example Applications

  1. MyExceptionListener.java

  2. MyListener.java

  3. Ping.java

    To achieve lower latency for this example application, you should change the value of implicit_batching_minimum_length from 2000 to 1 in the config.xml file.

  4. Pong.java

    To achieve lower latency for this example application, you should change the value of implicit_batching_minimum_length from 2000 to 1 in the config.xml file.

  5. SimpleBytePublisher.java

  6. SimpleByteSubscriber.java

  7. SimpleDestinationPublisher.java

  8. SimpleDestinationSubscriber.java

  9. SimpleMapPublisher.java

  10. SimpleMapSubscriber.java

  11. SimpleObjectPublisher.java

  12. SimpleObjectSubscriber.java

  13. SimpleTopicPublisher.java

  14. SimpleTopicSubscriber.java

  15. Version.java

Copyright 2005 - 2014 Informatica Corporation.