JMSOutput node

Use the JMSOutput node to send messages to JMS destinations.

Purpose

The JMSOutput node acts as a JMS message producer, and can publish all six message types that are defined in the Java™ Message Service Specification version 1.1 or 2.0. Messages are published by using method calls, which are described in the JMS specification.

The JMSOutput node is contained in the JMS drawer of the palette, and is represented in the IBM® Integration Toolkit by the following icon:

JMSOutput node icon

Using the JMSOutput node in a message flow

Message flows that handle messages that are received from connections to JMS providers must always start with a JMSInput node. If you include the JMSOutput node in a message flow, you do not need to include a JMSInput node; but if you do not include a JMSInput node, you must include the MQJMSTransform node to transform the message to the format that is expected by the JMSOutput node.

If you are propagating JMS messages and creating a message flow to use as a subflow, use an instance of the JMSOutput node as the last node to create an out terminal for the subflow.

Controlling the type of the JMS output message

In the JMS message tree, the JMS message type is represented by the PayloadType field of the Message_MetaData subfolder. To control the type of JMS message that is created by the JMSOutput node, use ESQL code to set the Payload value, as shown in the following example:
SET OutputRoot.JMSTransport.Transport_Folders.Message_MetaData.PayloadType=Payload value

For more information about the JMS message tree and payload values, see Representation of messages in the JMS Transport.

Sending a JMS message to a destination list

To send a JMS message to a destination list, ensure that the following conditions are met.
  • Select Send to destination list in local environment on the Basic properties tab of the JMSOutput node.
  • Set up the list in the local environment, as shown in the following example.
    CREATE PROCEDURE CreateJMSDestinationList() BEGIN
      SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[1]  = 'jndi://TestDestQueue1';
      SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[2]  = 'jndi://TestDestQueue2';
      SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[3]  = 'jndi://TestDestQueue3';
    END;
    
  • Ensure that the message model (point-to-point or publish/subscribe) matches the model that is used by the JMSOutput node. In this case, the model is point-to-point.
  • If the destination name in the list is prefixed with the string "jndi://", it indicates to the JMSOutput node that the value represents the name of a JNDI administered object, which needs to be looked up. Alternatively, if the JMS provider-specific format for a destination is known, it can be used; for example, queue://qmgrname/queuename for WebSphere® MQ. Otherwise, the value is used to create a temporary destination.
  • The items to which the JMS destination list refers represent JMS destinations that can be either JMS queues or JMS topics. These destination types must be consistent with the connection factory type that is specified in the JMSOutput node that will process the destination list. For example, a JMS queue destination can be processed by a JMS queue connection factory or a generic JMS connection factory. Similarly, a JMS topic destination can be processed by a JMS topic connection factory or a generic JMS connection factory.
For further information about using local environment variables in a JMSOutput node, see Using LocalEnvironment variables with JMSOutput and JMSReply nodes.

Making the JMS provider client available to the JMS nodes

Configurable services are defined for a number of JMS providers. You can choose one of the predefined services, or you can create a new service for a new provider, or for one of the existing providers. The predefined services are listed in Configurable services properties.

  • If you want to use the WebSphere MQ JMS provider, and you have installed WebSphere MQ in the default location on the integration node system, the properties are already set and you do not have to make any changes.
  • If you want to use the WebSphere MQ JMS provider, and you have installed WebSphere MQ in a different (non-default) location, or if you want to use one of the other defined services, you must set the jarsURL property to identify the location of the service JAR files on the integration node system. On Windows, the file location cannot be a mapped network drive on a remote Windows computer; the directory must be local or on a Storage Area Network (SAN) disk.

    Use the mqsireportproperties command to view the provider properties, and the mqsichangeproperties command to set or modify the properties.

  • If no service is defined for your JMS provider, or if you want to create another service for an existing JMS provider, use the mqsicreateconfigurableservice command to identify the new service and set its properties.
  • When you configure the node, select the appropriate service from the list of predefined services shown for the JMS provider name property, or type in the name of your new service.
  • Some JMS providers provide an alternative interface from the standard JMS specification for particular JMS API calls. In these cases, IBM supplies a Java JAR file to interface with that proprietary API. For example, if the JMS nodes use BEA WebLogic as the JMS provider, and the nodes need to participate in an XA coordinated message flow, you must modify the configurable services properties that are associated with that vendor. For more information, see Configuring the integration node to enable a JMS provider's proprietary API.
  • To connect to different versions of a JMS provider, create a JMSProviders configurable service for each version of the JMS provider, then set the jarsURL property to a unique path.

Using the Message Destination Mode

The JMSOutput node acts as a message producer and supports the following message scenarios: For more information about how to build JMS destination lists, see Populating Destination in the local environment tree.

Sending a datagram message

A datagram is a self-contained, independent entity of data that carries sufficient information to be routed from the source to the destination computer, without reliance on earlier exchanges between the source and destination computer and the transporting network. The following instructions describe how to send a datagram message:
  1. On the Basic tab, set the message destination depending on the message model that is being used. Set one of the following properties to a valid JNDI administered object name:
    • Publication Topic
    • Destination Queue
  2. Leave the Reply To Destination field blank.
The node resolves the name of the JNDI administered object, which is supplied in either the Publication topic or Destination queue property, and sends the message to that JMS destination.

Sending a reply message

The sender of a message might want the recipient to reply to the message. In this case, the JMSOutput message can treat the outgoing message as a reply, and route it according to the value that is obtained from the JMSReplyTo property from the request message. You can modify the value of the JMSReplyTo property in the MbMessage; for example, using a Compute node or a JavaCompute node. This action allows dynamic routing of messages from the JMSOutput node. The node sends the message to the JMS destination name that is set in the JMSReplyTo field of the MbMessage Tree.

The JMSReplyTo value in the MbMessage Tree represents the name of the JMS Destination that is resolved from JNDI. For example:
queue://QM_mn2/myJMSQueue4
In this case, the value is the JMS-provider specific representation of a JMS destination for the WebSphere MQ JMS provider.
If you do not want to specify a resolved JMS destination name, the JMSOutput node can also accept a JNDI administered object name in the JMSReplyTo field. However, the node must resolve an administered object name through JNDI before it can route the message to the underlying JMS destination. In this case, the value in the JMSReplyTo field must be prefixed with the string: jndi://. For example:
jndi://jmsQ4
where jmsQ4 is the name of the JNDI-administered object.

Performance might be affected when you use this method because of the need to look up the administered object in JNDI.

Sending a request message

The JMSOutput node can send a message to a JMS destination with the expectation of a response from the message consumer that processes the request. The following instructions describe how to send a request message:
  1. On the Basic tab, set the message destination depending on the message model that is being used. Set one of the following properties to a valid JNDI-administered object name:
    • Publication Topic
    • Destination Queue
  2. The JMSReplyTo destination in the outgoing message can be derived from the JMSReplyTo field of the MbMessage Tree that is passed to the node. Alternatively, this value can be overridden by a JNDI-administered object name that is set in the Reply To Destination node property.

    To allow the JMSOutput node to set the JMSReplyTo property dynamically in the outgoing message, leave the Reply To Destination field blank on the Basic tab, and set the JMSReplyTo value in the MbMessage using a Compute node or a JavaCompute node.

The node looks first for a value in the JMSReplyTo field of the MbMessage. If the node finds the value, it passes this value into the JMSReplyTo field of the outgoing message. However, if the Reply To Destination field of the Basic tab has been specified, this value overrides anything that is set previously in the JMSReplyTo property of the outgoing message, after first resolving the name of the JNDI-administered object.

The node resolves the name of the JNDI-administered object that is supplied in either Publication Topic or Destination Queue, and sends the message to that JMS destination.

Invoking an output message callback function

The cciOutputMessageCallback function can be registered as a callback and invoked whenever a message is sent by a JMSOutput node. See cciOutputMessageCallback.

If the user exit state is active, the cciOutputMessageCallback function is invoked for every output message that is sent successfully from a JMSOutput node where the callback is registered.

If the node provides WrittenDestination information in the LocalEnvironment tree, the callback is invoked after this information is created. See Using LocalEnvironment variables with JMSOutput and JMSReply nodes.

Working with the JMS message ID

The JMS message ID is generated by the JMS provider when a message is sent by the JMSOutput node. You cannot set the message ID in the message flow, but you can use one of the following methods to obtain the generated ID after the message has been sent:
  • Connect a Compute node to the Out terminal.

    Connect a Compute node to the Out terminal of a JMSOutput node and interrogate the WrittenDestination List. For more information, see Viewing the logical message tree in trace output.

    An entry for a JMSOutput node has the following format:
    WrittenDestination = (
       JMS = (
          DestinationData = (
            destinationName = 'queue://jmsQueue1'
            initialContext = 'com.sun.jndi.fscontext.RefFSContextFactory'
            JMSMessageID = ID:414d512054657374514d2020202020206ab98b4520017a02'
            JMSCorrelationID = 'ABCDEFGHIJKLMNOPQRSTUVW'
      )
     )
    )
  • Configure a user exit to process an output message callback event. For more information, see Exploiting user exits.

Configuring for coordinated transactions

When you include a JMSOutput node in a message flow, the value that you set for Transaction Mode defines whether messages are sent under syncpoint.

  • If you set the Transaction Mode to Yes, and the Coordinated transaction flow property is selected, the message is sent under external syncpoint coordination; that is, within a WebSphere MQ unit of work. Any messages that are sent subsequently by an output node in the same instance of the message flow are put under syncpoint, unless the output node overrides this setting explicitly.
  • If you set the Transaction Mode to Yes, and the Coordinated transaction flow property is not selected, the message is sent under the local syncpoint control of the JMSOutput node. Any messages that are sent subsequently by an output node in the flow are not put under local syncpoint, unless an individual output node specifies that the message must be put under local syncpoint.
  • If you set the Transaction Mode to No, the message is not sent under syncpoint. Any messages that are sent subsequently by an output node in the flow are not put under syncpoint, unless an individual output node specifies that the message must be put under syncpoint.

When you want to send messages under external syncpoint, you must perform additional configuration steps, which need to be applied only the first time that a JMSOutput or JMSInput is deployed to the integration node for a particular JMS provider; see Configuring JMS and SOAP nodes to support globally coordinated transactions.

If the JMSOutput node uses BEA WebLogic as the JMS provider, and the nodes need to participate in coordinated message flow, see Making the JMS provider client available to the JMS nodes.

Connecting the terminals

Connect the In terminal of the JMSOutput node to the node from which outbound messages are routed.

Connect the Out terminal of the JMSOutput node to another node in the message flow to process the message further, to process errors, or to send the message to an additional destination.

Terminals and properties

When you have put an instance of the JMSOutput node into a message flow, you can configure it; see Configuring a message flow node. The properties of the node are displayed in the Properties view. All mandatory properties that do not have a default value defined are marked with an asterisk.

The terminals of the JMSOutput node are described in the following table.
Terminal Description
In The input terminal that accepts a message for processing by the node.
Failure The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages that are propagated to this terminal are not validated.
Out The output terminal to which the message is routed if it has been successfully put to the output destination (topic or queue).

The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined), the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file to deploy it).

The Description properties of the JMSOutput node are described in the following table.
Property M C Default Description
Node name No No The node type, JMSOutput The name of the node.
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.
The Basic properties of the JMSOutput node are described in the following table.
Property M C Default Description mqsiapplybaroverride command property
Destination Queue No Yes   The name of the queue to which the node publishes outgoing messages. If the JMSOutput node is to be used to send point-to-point messages, enter the Destination queue name for the JMS queue name that is listed in the bindings file. destinationQueueName
Publication Topic No Yes   The name of the topic to which the node publishes messages.
  • If this property is configured, the node operates only in the publish/subscribe message domain.
  • This property is mutually exclusive with the Destination queue property.
  • The Publication Topic name must conform to the standards of the JMS provider that is being used by the node.
topic
Reply to destination No Yes   The name of the JMS destination to which the receiving application must send a reply message. For a reply message to be returned to this JMS destination, the JMS destination name must be known to the domain of the JMS provider that is used by the receiving client. You can enter a JMS destination, which can be either a subscription queue or a destination topic.

The default value is blank, in which case the JMS output message can be regarded as a datagram. If the field is blank, the JMSOutput node does not expect a reply from the receiving JMS client.

replyToDestination
Send to destination list in local environment No Yes Cleared When you have built a list of JMS destinations in the local environment, select this check box to use the destination list. If you do not select this check box, the node uses the configured JMS destination. If you select this check box but you have not built a list of JMS destination in the local environment, the node uses the configured JMS destination. useDistList
The JMS Connection properties of the JMSOutput node are described in the following table.
Property M C Default Description mqsiapplybaroverride command property
JMS provider name Yes No WebSphere MQ Select a JMS vendor name from the list, or enter a name of your choice. When you select a name from the list, the Initial Context Factory property is updated automatically with the relevant Java class. If you enter your own JMS provider name, you must also enter a value for the Initial Context Factory. The name must match the name of a JMSProviders configurable service defined for the integration node to which you deploy the message flow. For more information, see JMSProviders configurable service.  
Initial Context Factory No Yes com.sun.jndi.fscontext. RefFSContextFactory This property is the starting point for a JNDI namespace. A JMS application uses the initial context to obtain and look up the connection factory and queue or topic objects for the JMS provider.

If you select a JMS provider name from the list in JMS provider name, the Initial Context Factory property is updated automatically with the relevant Java class. If you enter your own JMS provider name, you must also enter a value for the Initial Context Factory. The default value is com.sun.jndi.fscontext.RefFSContextFactory, which defines the file-based initial context factory for the WebSphere MQ JMS provider.

If the node is set to use your own JMS provider, and the corresponding Configurable services property of the mqsichangeproperties definition has the InitialContextFactory attribute set, this overrides the setting on the node.

initialContextFactory
Location JNDI Bindings No Yes   The system path or the LDAP location for the bindings file. The bindings file contains definitions for the JNDI-administered objects that are used by the JMSOutput node.
When you enter a value for Location JNDI Bindings, ensure that it complies with the following instructions:
  • Construct the bindings file before you deploy a message flow that contains a JMSOutput node.
  • Do not include the file name of the bindings file in this field.
  • If you have specified an LDAP location that requires authentication, configure both the LDAP principal (userid) and LDAP credentials (password) separately. These values are configured at integration node level. For information about configuring these values, see mqsicreatebroker command and mqsichangebroker command.
  • The string value must include a supported URL prefix that has a URL handler that is available on the class path.

For information about constructing the JNDI-administered objects bindings file, see the documentation that is supplied with the JMS provider.

If the node is set to use your own JMS provider, and the corresponding Configurable services property of the mqsichangeproperties definition has the jndiBindingsLocation attribute set, this overrides the setting on the node.

locationJndiBindings
Connection Factory Name No Yes   The name of the connection factory that is used by the JMSOutput node to create a connection to the JMS provider. This name must already exist in the bindings file. The Connection factory can be a JMS QueueConnectionFactory or a JMS TopicConnectionFactory, but it must match the message model that is used by the node. Alternatively, you can specify the generic JMS ConnectionFactory, which can be used for both JMS queue or JMS topic destinations. connectionFactoryName
The Advanced properties of the JMSOutput node are described in the following table.
Property M C Default Description
New Correlation ID No Yes   If the JMSOutput node is required to generate a new Correlation ID for the message, select New Correlation ID. If you leave the check box cleared, the Correlation ID of the output message is taken from the JMSCorrelationID field in the JMSTransport_Header_Values section of the message tree.
Transaction Mode Yes No No
This property controls whether the message is received under a JMS transaction. Valid values are Yes and No.
  • Select No to receive the message using a non-transactional JMS session.
  • Select Yes to receive the message using a transactional JMS session. The JMS transaction can be either local or XA coordinated. To use an XA transaction, using an XA JMS session, you must also select the message flow property Coordinated Transaction in the BAR file properties. See Configuring JMS and SOAP nodes for local transactions.
The value set for Transaction mode on the JMSOutput node is inherited by nodes downstream in the message flow that have their Transaction mode set to Automatic. Other resources that perform work within the message flow, such as DB2® or WebSphere MQ, use transactions regardless of the node's Transaction mode setting, and commit their transaction after the message is processed.
Delivery Mode No Yes Non Persistent This property controls the persistence mode that a JMS provider uses for a message. Valid values are:
  • Automatic: the mode from the input message is inherited
  • Persistent: the message survives if the JMS provider has a system failure
  • Non Persistent: the message is lost if the JMS provider has a system failure
Message Expiration (ms) No Yes 0 This property controls the length of time, in milliseconds, for which the JMS provider keeps the output JMS message. The default value, 0, is used to indicate that the message must not expire.
Select Inherit from header or enter an integer that represents a number of milliseconds. If you select Inherit from header, the property inherits the value of the JMSExpiry field in the JMS message, which is found at the following location:
OutputRoot.JMSTransport.Transport_Folders.Header_Values.JMSExpiration
Message Priority No Yes 4 This property assigns relative importance to the message and it can be used for message selection by a receiving JMS client application or a JMSOutput node.

Select a value between 0 (lowest priority) and 9 (highest priority) or select Inherit from header.

The default value is 4, which indicates medium priority. Priorities in the range 0 to 4 relate to typical delivery. Priorities in the range 5 to 9 relate to graduations of expedited delivery. If you select Inherit from header, the property inherits the value of the JMSPriority field in the JMS message, which is found at the following location:
OutputRoot.JMSTransport.Transport_Folders.Header_Values.JMSPriority
Message Type No Yes Determine output message type from the JMS Message Tree Select a value from the list to configure the type of JMS message that is produced by the JMSOutput node. If you do not set a value for this property, the node assumes the output type from the metadata PayLoadType field in the JMS message tree, as indicated by the default value, Determine output message type from the JMS Message Tree. Valid values are:
  • Determine output message type from the JMS Message Tree
  • TextMessage
  • BytesMessage
  • MapMessage
  • StreamMessage
  • ObjectMessage
  • Base JMS message with no payload
The Validation properties of the JMSOutput node are described in the following table. For more information about Validation properties, see Validating messages and Validation properties.
Property M C Default Description mqsiapplybaroverride command property
Validate No Yes Inherit This property controls whether validation takes place. Valid values are None, Content, Content And Value, and Inherit. validateMaster
Failure Action No No Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.  
The Monitoring properties of the node are described in the following table.
Property M C Default Description
Events No No None Events that you have defined for the node are displayed on this tab. By default, no monitoring events are defined on any node in a message flow. Use Add, Edit, and Delete to create, change or delete monitoring events for the node; see Configuring monitoring event sources by using monitoring properties for details.

You can enable and disable events that are shown here by selecting or clearing the Enabled check box.