You configure options/attributes for Ultra Messaging JMS object creation in one of three general ways:
Using a UM configuration XML file
Using UMM
Using a JMSConfig file
This section discusses the following topics:
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.
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:
Make sure that all lines in the second and third section are commented out.
Un-comment the line, java.naming.factory.initial = com.latencybusters.jms.LBMXmlContextFactory
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.
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.
<context name="uJMSConnectionFactory" template=""> - Accepts general UM configuration option values for the contexts, sources, and receivers used by your applications.
<context name="uJMSConnectionFactory-UMS"> - Accepts option values specific to any Streaming activities of your applications.
<context name="uJMSConnectionFactory-UMP"> - Accepts option values specific to Persistent activities, such as store configuration options.
<context name="uJMSConnectionFactory-UMQ"> - Accepts option values specific to Queueing activities, such as queue configuration options.
<ConnectionFactory name="uJMSConnectionFactory"> - Accepts JMS Factory option values such as default_message_type or default_topic_type.
<Destination name="TempQueue"> - Accepts JMS destination option values such as type or dest_type .
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.
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:
Make sure that all lines in the first and third section are commented out.
Un-comment the line, java.naming.factory.initial = com.latencybusters.jms.UMMContextFactory
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.
Save the jndi.properties 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:
Make sure that all lines in the first and second section are commented out.
Un-comment the line, java.naming.factory.initial = com.sun.jndi.fscontext.RefFSContextFactory
Un-comment java.naming.provider.url = file:..
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.
You can configure as many ConnectionFactories as needed. The ConnectionFactory element contains the following sets of attributes.
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
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>
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.
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>
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.