5. Ultra Messaging JMS Configuration

You configure options/attributes for Ultra Messaging JMS object creation in one of three general ways:

This section discusses the following topics:

5.1. jndi.properties

The /jmsclient/bin/jndi.properties governs from where your JMS applications receive their configuration data. Regardless of which of the three configuration methods you decide to use, you must edit or ensure that this file matches the selected method. The jndi.properties, in its default form, appears below. Note that the file specifies the third configuration method (JMSConfig XML file).

## Use the LBM XML based context factory
#java.naming.factory.initial = com.latencybusters.jms.LBMXmlContextFactory
## where the xml config file is one of
#java.naming.provider.url = classpath:umjms.xml
#java.naming.provider.url = file:C:/umjms.xml
#java.naming.provider.url = file:/home/user1/umjms.xml
 
## Use the UMM based context factory
#java.naming.factory.initial = com.latencybusters.jms.UMMContextFactory
## where the ummd is running at the following url
#java.naming.provider.url = localhost:15701
#java.naming.security.principal = JMSUser
#java.naming.security.credentials = JMSUser
 
## Use Sun's RefFSContextFactory (with .bindings file)
java.naming.factory.initial = com.sun.jndi.fscontext.RefFSContextFactory
## where the .bindings file is
java.naming.provider.url = file:.
   

The next three sections describe how to edit the appropriate sections of this file.

5.2. Configuring Ultra Messaging JMS with a UM XML File

You can create an XML configuration file using an XML editor or by using the UMM GUI. See Using the UMM GUI for details. With this method, the UMM Daemon doesn't have to be running when your Ultra Messaging JMS applications start.

To use this configuration method, edit the jndi.properties file as follows:

  1. Make sure that all lines in the second and third section are commented out.

  2. Un-comment the line, java.naming.factory.initial = com.latencybusters.jms.LBMXmlContextFactory

  3. Un-comment one of the java.naming.provider.url lines and supply the path and filename of your XML configuration file. See also Configuring Ultra Messaging JMS with Ultra Messaging Manager.

  4. Save the jndi.properties file.

The UM XML configuration file has the following high-level structure.

<?xml version="1.0" encoding="UTF-8"?>
<um-configuration version="1.0">
 
<applications>
 <application name="uJMS">
 
  <contexts>
    <context name="uJMSConnectionFactory" template="">
      <sources/>
      <receivers/>
      <wildcard-receivers/>
      <options type="context"> 
    </context>
    <context name="uJMSConnectionFactory-UMS">
      <sources/>
       <receivers/>
       <wildcard-receivers/>
    </context>
    <context name="uJMSConnectionFactory-UMP">
      <sources/>
      <receivers/>
      <wildcard-receivers/>
    </context>
    <context name="uJMSConnectionFactory-UMQ">
      <sources/>
      <receivers/>
      <wildcard-receivers/>
    </context>
  </contexts>
 
  <event-queues>
    <event-queue/>
  </event-queues>
 
  <application-data>
    <ConnectionFactory name="uJMSConnectionFactory">
      <options type="ConnectionFactory">
      </options>
    </ConnectionFactory>
    <Destination name="TempQueue">
      <options type="Destination">
      </options>
    </Destination>
  </application-data>
 
 </application>
</applications>
</um-configuration>
   

Essentially, the structure has two parts. The first part contains the contexts that allow you to specify traditional UM configuration option values. The second part, <application-data>, allows you to specify JMS options to factories and destinations. The following details some of the major sections of the above high-level structure.

To see a more complete XML file, see /jmsclient/config/umjms.xml. Unlike the high-level structure above, this file contains relevant option values. You can also review the same information in the UMM GUI. The XML file you create must adhere to the high-level structure presented above.

5.3. Configuring Ultra Messaging JMS with Ultra Messaging Manager

You can use the UMM GUI to create configurations for your JMS applications. With this method, the UMM Daemon must be running to provide server configuration and license information to your JMS applications when they start. To use this method, edit the jndi.properties file as follows:

  1. Make sure that all lines in the first and third section are commented out.

  2. Un-comment the line, java.naming.factory.initial = com.latencybusters.jms.UMMContextFactory

  3. Un-comment java.naming.provider.url and substitute an IP address and port number for localhost:15701 to specify where the UMM Daemon runs. You can add a comma-separated list of daemons.

  4. Save the jndi.properties file.

5.4. Configuring Ultra Messaging JMS with a JMSConfig XML File

Note: This is a legacy feature and no longer recommended.

With this method, you use the /jmsclient/bin/config.bat or /jmsclient/bin/config.sh script to create a .bindings file from your config.xml. To use this method, edit the jndi.properties file as follows:

  1. Make sure that all lines in the first and second section are commented out.

  2. Un-comment the line, java.naming.factory.initial = com.sun.jndi.fscontext.RefFSContextFactory

  3. Un-comment java.naming.provider.url = file:..

  4. Save the jndi.properties file.



The JMSConfig.xml file allows you to assign UM configuration values to the Ultra Messaging JMS ConnectionFactory and specify message topics as destinations. You can create a JMSConfig format XML configuration file using an XML editor or text editor. See /jmsclient/config/config.xml for an example of a JMSConfig file. This is the configuration file for the UM JMS examples described in Ultra Messaging JMS Quick Start.

The configuration file has the following high-level structure.

<JMSConfig>
    <ConnectionFactories>
        <ConnectionFactory>
            <FactoryAttributes>
                <Attribute/>
            </FactoryAttributes>
            <ContextAttributes>
                <Attribute "UM configuration options, scope=context" />
            </ContextAttributes>
            <SourcetAttributes>
                <Attribute "UM configuration options, scope=source" />
            </SourcetAttributes>
            <ReceiverAttributes>
                <Attribute "UM configuration options, scope=receiver" />
            </ReceiverAttributes>
            <WildcardRceiverAttributes>
                <Attribute "UM configuration options, scope=wildcard-receiver" />
            </WildcardReceiverAttributes>
        </ConnectionFactory>
    </ConnectionFactories>
    <Destinations>
        <Destination>
            <DestinationAttributes>
                <Attribute/>
            </DestinationAttributes>
            <ReceiverAttributes>
                <Attribute/>
            </RecieverAttributes>
        </Destination>
    </Destinations>
</JMSConfig>
       

This section discusses the following topics.

5.4.1. ConnectionFactory Attributes

You can configure as many ConnectionFactories as needed. The ConnectionFactory element contains the following sets of attributes.

5.4.1.1. FactoryAttributes

See Ultra Messaging JMS Options for ConnectionFactory options.

The following is an example ConnectionFactory configuration that uses all the default values.

<ConnectionFactories>
    <ConnectionFactory>
        <FactoryAttributes>
            <Attribute name="CLIENT_ID" value="UME1"/>
            <Attribute name="DEBUG" value="false"/> 
            <Attribute name="DEFAULT_TOPIC_TYPE" value="UME"/>
            <Attribute name="DEFAULT_TEMP_TOPIC_TYPE" value="LBM"/>
            <Attribute name="USE_APP_HEADER" value="true"/>
            <Attribute name="DEFAULT_MESSAGE_TYPE" value="TextMessage"/>
        </FactoryAttributes>
    </ConnectionFactory>
</ConnectionFactories>
       

Note: The following message methods will not work if set USE_APP_HEADER to false. (<Attribute name="USE_APP_HEADER" value="false"/>).

  • getJMSCorrelationID/setJMSCorrelationID

  • getJMSDeliveryMode/setJMSDeliveryMode

  • getJMSDestination/setJMSDestination

  • getJMSExpiration/setJMSExpiration

  • getJMSMessageID/setJMSMessageID

  • getJMSPriority/setJMSPriority

5.4.1.2. ContextAttributes

A ConnectionFactory's Context Attributes consist of any UM Configuration Options with the scope of Context. See the Ultra Messaging® Configuration Guide for all configuration options. The following are examples of ContextAttributes.

<ContextAttributes>
    <Attribute name="operational_mode" value="sequential"/>
    <Attribute name="resolver_multicast_ttl" value="16"/>
    <Attribute name="resolver_multicast_address" value="225.72.39.173"/>
    <Attribute name="mim_address" value="225.72.39.174"/>
    <Attribute name="transport_lbtrm_multicast_address_low" value="225.73.39.200"/>
    <Attribute name="transport_lbtrm_multicast_address_high" value="225.73.39.210"/>
    <Attribute name="request_tcp_port_low" value="16000"/>
    <Attribute name="request_tcp_port_high" value="16010"/>
    <Attribute name="transport_lbtrm_source_port_low" value="15000"/>
    <Attribute name="transport_lbtrm_source_port_high" value="15500"/>
    <Attribute name="transport_tcp_maximum_ports" value="20"/>
    <Attribute name="transport_tcp_port_low" value="16500"/>
    <Attribute name="transport_tcp_port_high" value="16600"/>
    <Attribute name="resolver_unicast_port_high" value="45000"/>
    <Attribute name="transport_lbtrm_data_rate_limit" value="500000000"/>
    <Attribute name="transport_lbtrm_retransmit_rate_limit" value="1000000"/>
    <Attribute name="transport_lbtrm_receiver_socket_buffer" value="8000000"/>
    <Attribute name="request_tcp_reuseaddr" value="1"/>
</ContextAttributes>
               

5.4.1.3. SourceAttributes

A ConnectionFactory's Source Attributes consist of any UM Configuration Options with the scope of Source. See the Ultra Messaging Configuration Guide for all configuration options. The following are examples of SourceAttributes.

<SourceAttributes>
    <Attribute name="transport" value="lbtrm"/>
    <Attribute name="late_join" value="1"/>
    <Attribute name="ume_store_name" value="JMSStore1"/>
    <Attribute name="ume_store_name" value="JMSStore2"/>
    <Attribute name="ume_store_name" value="JMSStore3"/>
    <Attribute name="ume_store_behavior" value="qc"/>
    <Attribute name="ume_proxy_source" value="1"/>
    <Attribute name="umq_queue_name" value="JMSQueue"/>
    <Attribute name="implicit_batching_minimum_length" value="1"/>
</SourceAttributes>
               

Note: You can define and add stores to a source's store list by using either the ume_store or ume_store_name attribute. We suggest the latter (which uses a name instead of an IP/port address), as this facilitates JMS deployment to different machines and/or the UM Gateway.

5.4.1.4. ReceiverAttibutes

A ConnectionFactory's Receiver Attributes consist of any UM Configuration Options with the scope of Receiver. See the Ultra Messaging Configuration Guide for all configuration options. The following are examples of Receiver Attributes.

<ReceiverAttributes>
    <Attribute name="umq_receiver_type_id" value="100"/>
</ReceiverAttributes>
               

5.4.2. Destination Attributes

Destinations correspond to Ultra Messaging topics. See Ultra Messaging JMS Options for destinations options.

The following is an example destination configuration.

<Destination name="ReplyTopic" type="Topic">
    <DestinationAttributes>
            <Attribute name="REGID" value="4400"/>
        <Attribute name="WILDCARD" value="false"/>
        <Attribute name="TYPE" value="LBM"/>
    </DestinationAttributes>
</Destination>
                   

Copyright (c) 2004 - 2014 Informatica Corporation. All rights reserved.