This topic contains sections marked as revised for this release

WebSphere Message Brokers
File: ac24830_
Writer: John Cooper

Reference topic

This build: July 31, 2007 21:19:35

JMSOutput node

This topic describes the JMSOutput node.

This topic contains the following sections:

Purpose

Use the JMSOutput node to send messages to JMS destinations. 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. 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 workbench by the following icon:

JMSOutput node icon

Using the JMSOutput node in a message flow

The following sample contains a message flow in which the JMSOutput node is used. Refer to this sample for an example of how to use the JMSOutput node. You can view samples only when you use the information center that is integrated with the Message Brokers Toolkit.

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 in order to create an out terminal for the subflow.

Making the JMS provider client available to the JMS nodes

Choose one of the following methods to make the JMS provider available to the JMS nodes.
  • Use the mqsicreateconfigurableservice command to create a new object name for the JMS provider. For further information about this command, see mqsicreateconfigurableservice command.

    You can use the -c parameter on the mqsichangeproperties command to change the property settings for an object name that already exists in the broker persistent store. For a JMS provider, this object name is a JMS Provider name. Use the mqsideleteconfigurableservice command to delete a JMS provider resource that was created by the mqsicreateconfigurableservice command.

    You can use the -c parameter on the mqsireportproperties command to report on the properties of any JMS provider resource (both default and user-defined).

  • On distributed systems, copy the Java™ .jar files and any native libraries for the JMS provider client into the broker shared-classes directory; for example, C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes on Windows. Copying the files to the shared-classes directory ensures that the Java class path for the JMS nodes is set correctly.
  • z/OS platform On z/OS, no shared-classes directory is used; instead, perform the following steps:
    1. Specify each JMS provider Java .jar file in the class path in the BIPPROF member of the broker’s Partitioned Data Set (PDS).
    2. Update the LIBPATH with any native libraries.
    3. Submit the BIPGEN JCL job to update the broker ENVFILE.

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 across the JMS Transport.

Using the Message Destination Mode

The JMSOutput node acts as a message producer and supports the following message scenarios:

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 Publication Topic or Destination Queue, 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, it is necessary to resolve an administered object name through JNDI before the node can route the message to the underlying JMS Destination. In this case, the value in the JMSReplyTo field should be prefixed with the string: jndi:\\. For example:
jndi:\\jmsQ4
where jmsQ4 is the name of the JNDI-administered object.

Performance might be slightly impacted 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.

Configuring the JMSOutput node

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.

Configure the JMSOutput node as follows:

  1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab.
  2. On the JMS Connection tab, set the following properties:
    • Enter an Initial context factory value. A JMS application uses the initial context to obtain and look up the JNDI administered objects for the JMS provider. The default value is com.sun.jndi.fscontext.RefFSContextFactory, which defines the file-based initial context factory for the WebSphere MQ JMS provider.

      To identify the name of the Initial Context Factory for the JMS provider, refer to the JMS provider documentation.

    • Enter a value for the Location JNDI bindings. This value specifies either the file 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 broker level. For information about configuring these values, refer to the mqsicreatebroker and mqsichangebroker commands.
      • The string value must include the leading keyword, which is one of:
        • file:/
        • iiop:/
        • ldap:/

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

    • Enter a Connection factory name. The connection factory name is used by the JMSOutput node to create a connection to the JMS provider. This name must already exist in the bindings file.
  3. On the Basic tab, if the JMSOutput node is to be used to publish a topic, set the following properties:
    • If the message is to be treated as a reply, select Send reply to the JMS header "JMSReplyTo" destination. The JMS provider is supplied with the JMSReplyTo value from the JMSTransport_Header_values section of the message tree.
    • 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.
    • Enter the name of the Publication Topic.
      • 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.
    • Enter a value for Reply To Destination. You can enter a JMS destination, which can be either a subscription queue or a destination topic. The Reply To Destination is the name of the JMS destination to which the receiving application should 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.

      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.

  4. On the Advanced tab, set the following properties:
    • If the JMSOutput node is required to generate a new Correlation ID for the message, select the check box. The check box is cleared by default; 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.
    • To define the transactional characteristics of how the message is handled, select the Transaction Mode:
      • Select None if the outgoing message is to be treated as non persistent. If you select this value, the message is sent using a non-transacted JMS session that is created using the Session.AUTO_ACKNOWLEDGE flag.
      • Select Local if the input node that received the message should coordinate the commit or roll-back of JMS messages that have been sent by the JMSOutput node, along with any other resources, such as DB2 or WebSphere MQ, that perform work within the message flow. If you select this value, the node uses a transacted JMS session.
      • Select Global if the JMSOutput node should participate in a global message flow transaction that is managed by the broker’s external syncpoint coordinator. The syncpoint coordinator is the broker’s queue manager on distributed systems, and RRS (Resource Recovery Services) on z/OS. If you select this value, any messages that are received by the node are globally coordinated using an XA JMS session.
    • You can set the persistence of the outgoing JMS message by using the Delivery Mode property. Select an option from the list:
      • Non Persistent to indicate to the JMS provider that the message should be treated as non persistent
      • Persistent to mark messages as persistent to the JMS provider and to ensure that they are preserved until they are delivered successfully to a receiving JMS client application
    • Enter a value, in milliseconds, for Message Expiration to request that the JMS provider keeps the output JMS message for a specified time. The default value 0 is used to indicate that the message should not expire.
    • To assign a relative importance to the message, select an option from the Message Priority list. This value can be used for message selection by a receiving JMS client application or a JMSOutput node. Valid values for message priority are from 0 (lowest) to 9 (highest). The default value is 4, which indicates medium priority. Priorities in the range 0 to 4 relate to normal delivery. Priorities in the range 5 to 9 relate to graduations of expedited delivery.
  5. On the Validation tab, set the properties that relate to output message validation:
    • Select an option from the Validate list:
      • None
      • Content and Value
      • Content
      • Inherit
      If you select Content and Value or Content, select a Failure Action from the list:
      • User Trace
      • Local Error Log
      • Exception (default value)
      • Exception List

    For more details, see Validating messages and Validation properties.

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.

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 Global, 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 Local, 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 None, 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.

The JMS provider can supply additional .jar files that are required for transactional support. Refer to the JMS provider documentation. For example, on distributed systems, the WebSphere MQ JMS provider supplies an extra .jar file, com.ibm,mqetclient.jar, which must be added to the broker shared-classes directory. Refer to Making the JMS provider client available to the JMS nodes in this topic.

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 broker for a particular JMS provider:
  • On distributed systems, the external syncpoint coordinator for the broker is WebSphere MQ. Before you deploy a message flow in which the Transaction Mode is set to Global, modify the queue manager .ini file to include extra definitions for each JMS provider Resource Manager that participates in globally coordinated transactions:
    • Windows platform On Windows systems, if you have WebSphere MQ Version 5 installed:
      1. Start WebSphere MQ Services.
      2. Right-click the queue manager name and click Properties.
      3. Click the Resource properties tab.
      4. Set the SwitchFile property to the following value:
        install_dir/bin/ JMSSwitch.dll  
        XAOpenString=Initial Context,location JNDI,Optional_parms
        ThreadOfControl=THREAD 
    • Windows platform On Windows systems, if you have WebSphere MQ Version 6.0 installed:
      1. Start WebSphere MQ Explorer.
      2. Right-click the queue manager name in the left pane and click Properties.
      3. Click XA resource managers in the left pane.
      4. Set the SwitchFile property to the following value:
        install_dir/bin/ JMSSwitch.dll  
        XAOpenString=Initial Context,location JNDI,Optional_parms
        ThreadOfControl=THREAD 
      Refer to the WebSphere MQ System Administration Guide for more information.
    • Linux platform UNIX platform On Linux and UNIX systems, add a stanza to the queue manager's .ini file for each JMS provider.
      For example:
      XAResourceManager:
      Name=Jms_Provider_Name 
      SwitchFile=/install_dir/bin/ JMSSwitch.so
      XAOpenString=Initial Context,location JNDI,Optional_parms
      ThreadOfControl=THREAD
      Where:
      Name
      is an installation-defined name that identifies a JMS provider Resource Manager.
      SwitchFile
      is the file system path to the JMSSwitch library that is supplied in the bin directory of the broker.
      The values for XAOpenString are as follows:
      • Initial Context is the value that is set in the JMSInput node basic property Initial context factory.
      • location JNDI is the value that is set in the JMSInput node basic property Location of JNDI. This value should include the leading keyword, which is file:/, iiop:/ or ldap:/
      The following parameters are optional:
      • LDAP Principal matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands.
      • LDAP Credentials matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands.
      • Recovery Connection Factory Name is the JNDI administered connection factory that is defined in the bindings file. If a value is not specified, a default value for recoverXAQCF must be added to the bindings file. In either case, the Recovery Connection Factory should be defined as an XA Queue Connection Factory for the JMS provider that is associated with the Initial Context Factory.

      The optional parameters are comma-separated and are positional. Therefore, any parameters that are missing must be represented by a comma.

      1. Update the Java CLASSPATH environment variable for the broker's queue manager to include a reference to xarecovery.jar; for example:
        install_dir/classes/xarecovery.jar
      2. Update the Java PATH environment variable for the broker's queue manager to point to the bin directory, which is where the switch file is located; for example:
        install_dir/bin

      Refer to the WebSphere MQ System Administration Guide for more information.

      To use the same queue manager for both the broker and the JMS provider, ensure that your installation is at the minimum required level: Version 5.3 CSD12 or Version 6.0 Fix Pack 1 WebSphere® MQ Version 6.0 Fix Pack 1 or above is required for XA to use the same queue manager for both the broker and the provider.

    • z/OS platform On z/OS, the external syncpoint manager is Resource Recovery Services (RRS). The only JMS provider that is supported on z/OS is WebSphere MQ JMS. The only transport option that is supported for WebSphere MQ JMS on z/OS is the bind option.

      Syncpoint control for the JMS provider is managed with RRS syncpoint coordination of the queue manager of the broker. You do not need to modify the .ini file.

Draft comment:
This section to be added later: Configuring the node to handle message groups

WebSphere MQ supports message groups; you can specify that a message belongs to a group and that processing of the message and all other messages in the group must be handled as one transaction. Therefore, if the processing on one message in the group fails, all messages in the group are backed out. The message processing is committed when the last message in the group has been processed successfully and only if processing of all other messages in the group has been successful.

If it is important that all of the messages within the group are read from the queue and processed in the order in which they are defined in the group, you must complete the following actions:
  • Select the Commit by Message Group check box.
  • Select the Logical Order check box.
  • Set the Order Mode to By Queue Order or set the message flow property Additional Instances to 0. You can modify message flow properties when you add the message flow to the bar file for deployment.

    If you choose either or both of these options, the message flow processes the messages on a single thread of execution, and a message is processed to completion before the next message is retrieved from the queue. In all other cases, it is possible that multiple threads within a single message flow are processing multiple messages, and there is no guarantee that the final message in a group, the message that prompts the commit or roll back action, is processed to completion after all other messages in the group.

Ensure you do not have another message flow that is retrieving messages from the same input queue. If you do, there is no guarantee about the order in which the messages within a group are processed.

Terminals and properties

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 is successfully retrieved from the WebSphere MQ queue.
Catch The output terminal to which the message is routed if an exception is thrown downstream and caught by this node.

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 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 JMS Connection properties of the JMSOutput node are described in the following table.

Property M C Default Description
Initial Context Factory Yes Yes com.sun.jndi.fscontext.RefFSContextFactory This property is the starting point for a JNDI name space. A JMS application uses the initial context to obtain and look up the connection factory and queue or topic objects for the JMS provider.

The default value is that value used when WebSphere MQ Java is used as the JMS provider.

Location JNDI Bindings No Yes   The system path or the LDAP location for the bindings file.
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.

The Basic properties of the JMSOutput node are described in the following table.

Property M C Default Description
Send reply to the JMS header "JMSReplyTo" destination No Yes Cleared If this check box is selected, the JMS provider is supplied with the JMSReplyTo value from the JMSTransport_Header_values section of the message tree.
Destination Queue No Yes   The name of the queue to which the node publishes outgoing messages.
Publication Topic No Yes   The name of the topic from which the node receives published messages.
Reply to destination No Yes   The name of the JMS destination to which the receiving application should 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.

The Advanced properties of the JMSOutput node are described in the following table.

Property M C Default Description
New Correlation ID No Yes   This property is selected if a New Correlation ID is required.
Transaction Mode Yes No None This property controls whether the incoming message is received under syncpoint. Valid values are None, Local, and Global.
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 for which the JMS provider keeps the output JMS message. Values are in milliseconds and the default value, 0, is used to indicate that the message should not expire.
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.

The Validation properties of the JMSOutput node are described in the following table.

For more information about Validation properties refer to the related links.
Property M C Default Description
Validate Yes Yes None This property controls whether validation takes place. Valid values are None, Content, and Content And Value.
Failure Action Yes 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.
Include All Value Constraints Yes No Selected You cannot edit this property. If the check box is selected (the default), basic value constraint checks are included in Content and Value validation.
Fix Yes No None You cannot edit this property.
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:19:36

ac24830_ This topic's URL is: