JMSInput node

This topic contains the following sections:

Purpose

Use the JMSInput node to receive messages from JMS destinations. JMS destinations are accessed through a connection to a JMS provider. The JMSInput node acts as a JMS message consumer and can receive all six message types that are defined in the Java Message Service Specification, version 1.1. Messages are received by using method calls, which are described in the JMS specification.

The JMSInput node is represented in the workbench by the following icon:

JMSInput node icon

Using the JMSInput node in a message flow

The JMS Nodes sample sample contains a message flow in which the JMSInput node is used. Refer to this sample for an example of how to use the JMSInput node.

Message flows, which handle messages that are received from connections to JMS providers, must always start with a JMSInput node. If you include an output node in a message flow that starts with an JMSInput node, it can be any of the supported output nodes (including user-defined output nodes); you do not have to include an JMSOutput node. However, if you do not include a JMSOutput node, you must include the JMSMQTransform node to transform the message to the format that is expected by the output node.

If you are propagating JMS messages and creating a message flow to use as a subflow, you cannot use a standard input node; you must use an instance of the JMSInput node as the first node in order to create an In terminal for the subflow.

Restriction: There is currently a restriction when using the JMSInput node to receive publication topics. The node internally restricts the message flow property Additional Instances to zero to prevent the receipt of duplicate publications.

Making the JMS Provider client available to the JMS Nodes

For distributed platforms, copy the java .jar files and any native libraries for the JMS provider client into a the broker shared-classes directory. For example, on Windows C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes. This ensures that the java class path for the JMS nodes is set correctly.

For z/OS, there is no shared-classes directory. Instead you must specify each JMS provider java .jar file in the class path in the BIPPROF member of the broker’s PDS (Partitioned Data Set). Then update the LIBPATH with any native libraries, and submit the BIPGEN JCL job to update the broker ENVFILE.

Configuring the JMSInput node

When you have put an instance of the JMSInput node into a message flow, you can configure it. Right-click the node in the editor view and click Properties. The basic properties of the node are displayed in the properties dialog.

All mandatory properties that do not have a default value defined are marked with an asterisk on the properties dialog.

Configure the JMSInput node as follows:

  1. Select Basic in the properties dialog navigator and complete 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 JMSInput node.

      When you enter a value for Location JNDI Bindings, ensure that it is compliant with the following instructions:

      • Construct the bindings file before you deploy a message flow that contains a JMSInput node.
      • Do not include the filename of the bindings file in this field.
      • If you have specified an LDAP location that requires authentication, you must configure separately both the LDAP principal (userid) and LDAP credentials (password). These values are configured at broker level. For information on configuring these values, refer to the mqsicreatebroker and mqsichangebroker commands.
      • The string value should include the leading keyword, which is one of the following: file:/ , iiop:/, or 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 JMSInput node to create a connection to the JMS provider. This name must already exist in the bindings file.
    • Enter a Backout Destination name. Input messages are sent to this destination when errors prevent the message flow from processing the message, and the message must be removed from the input destination. The backout destination name must exist in the bindings file.
    • Enter a value for the Backout Threshold. This value determines when an input message is put to the Backout Destination. For example, if the value is 3, the JMS provider attempts to deliver the message to the input destination three times. After the third attempted delivery, the message is removed from the input destination and is sent to the backout destination. The default value is 0.
  2. Select Default in the properties dialog navigator and set values for the properties that describe the message domain, message set, message type, and message format.
    • If you are using the MRM or IDOC parser, select the correct message set from the drop-down list in Message Set. This list is populated with available message sets when you select MRM or IDOC as the domain.

      Leave Message Set blank for XML, XMLNS, JMS, , and BLOB parsers.

    • If you are using the MRM parser, select the correct message from the drop-down list in Message Type. This list is populated with messages that are defined in the message set that you have selected.

      Leave Message Type blank for XML, XMLNS, JMS, , BLOB, and parsers.

    • If you are using the MRM or IDOC parser, select the format of the message from the drop-down list in Message Format. This list includes all the physical formats that you have defined for this message set.

      Leave Message Format blank for XML, XMLNS, JMSMap, JMSStream, , and BLOB parsers.

  3. If the JMSInput node is to be used to subscribe to a topic, select Pub/Sub in the properties dialog navigator.
    • Enter the name of the Subscription Topic.
      • If this property is configured, the node operates in the publish/subscribe message domain only.
      • This property is mutually exclusive with Source Queue in the Point to Point properties section.
      • The Subscription Topic name must conform to the standards of the JMS provider that is being used by the node.

    • If the node is to receive publications from a durable subscription topic, enter a Durable Subscription ID.
      • Removing a durable subscription is a separate administration task. For information on removing a durable subscription, refer to the JMS provider documentation.
      • This property is valid only when a Subscription Topic string has been specified.
  4. If the JMSInput node is to be used to receive point to point messages, select Point to Point in the properties dialog navigator.
    • Enter the Source Queue name, where the Source Queue is the JMS queue that is listed in the bindings file.
  5. If filtering of messages is required, select Message Selectors in the properties dialog navigator.
    • If the JMS provider is required to filter messages based on message properties that are set by the originating JMS client application, enter a value for Application Property, specifying both the property name and the selection conditions; for example, OrderValue > 200.

      Leave this property blank if you do not want the input node to select based upon application property. Refer to JMS message selectors for a description of how to construct the message selector.

    • If the JMS provider is required to filter messages that have been generated at specific times, enter a value for Timestamp, where the value is an unqualified Java millisecond time; for example, 105757642321. Qualify the selector with operators such as BETWEEN or AND.

      Leave this property blank if you do not want the input node to select based on JMSTimeStamp.

    • If the JMS provider is required to filter messages based on the JMSDeliveryMode header value in the JMS messages, select an option for Delivery Mode from the drop-down list. You can choose from:
      • Non Persistent to receive messages marked as non persistent by the originating JMS client application. This is the default option.
      • Persistent to receive messages marked as persistent by the originating JMS client application.
    • If the JMS provider is required to filter messages based upon the JMSPriority header value in the JMS message, enter a value for Priority.

      Valid values for message priority are from 0 (lowest) to 9 (highest). For example, you can enter 5 to receive messages of priority 5. You can also qualify the selector; for example > 4 to receive messages with a priority greater than 4, or BETWEEN 4 AND 8 to receive messages with a priority in the range 4 to 8.

      Leave this property blank if you do not want the input node to select based on JMSPriority.

    • If the JMS provider is required to filter messages based upon the JMSMessageID header, enter a value for Message ID.

      Enter a specific Message ID, or enter a conditional selector; for example, enter> WMBRK123456 to return messages where the Message ID is greater than the WMBRK123456.

      Leave this property blank if you do not want the input node to make a selection based on JMSMessageID.

    • If the JMS provider is required to filter messages based upon the JMSRedelivered header, enter a value for Redelivered.

      Enter FALSE if the input node accepts only messages that have not been redelivered by the JMS Provider.

      Enter TRUE if the input node accepts only messages that have been redelivered by the JMS Provider.

      Leave this property blank if you do not want the input node to select based on JMSRedelivered.

    • If the JMS provider is required to filter messages based upon the JMSCorrelationID header, enter a value for Correlation ID.

      Enter a specific Correlation ID or enter a conditional string; for example, WMBRKABCDEFG returns messages whose Correlation ID matches this value.

      Leave this property blank if you do not want the input node to select based on JMSCorrelationID.

  6. Select Advanced in the properties dialog navigator.
    • To define the transactional characteristics of how the message is handled, select from the Transaction Mode drop-down list. You can choose one of the following options:
      • Select none if the incoming message is to be treated as non persistent. If you select this value, the message is received using a non transacted JMS Session that is created using the Session.AUTO_ACKNOWLEDGE flag.
      • Select local if the JMSInput node should coordinate the commit or roll back of JMS messages received by the 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 JMSInput node should participate in a global message flow transaction that will be managed by the broker’s external syncpoint coordinator. The syncpoint coordinator is the broker’s queue manager on distributed platforms and RRS (Resource Recovery Services) on z/OS. If you select this value, any messages received by the node are globally coordinated using an XA JMS Session.
  7. Select XMLNSC Parser Options in the properties dialog navigator.

    If you want to Use XMLNSC Compact Parser for XMLNS Domain select the check box.

    For Mixed Content Retain Mode, Comments Retain Mode, and Processing Instructions Retain Mode, the drop-down boxes offer the following choices:

    • None
    • All
  8. Select Description in the properties dialog navigator to enter a short description, a long description, or both.
  9. Click Apply to make the changes to the JMSInput node without closing the properties dialog. Click OK to apply the changes and close the properties dialog.

    Click Cancel to close the dialog and discard all the changes that you have made to the properties.

Connecting the terminals

For each message that is received successfully, the JMSInput node routes the message to the out terminal. If this fails, the message is retried. If the retry threshold is reached, where the threshold is defined by the BackoutThreshold attribute of the node, the message is routed to the failure terminal.

You can connect nodes to the failure terminal to handle this condition. If you have not connected nodes to the failure terminal, the message is written to the backout destination. If a backout destination has not been provided, an error message is issued and the node stops processing further input. The error message is bip4669.

If the message is caught by the JMSInput node after an exception has been thrown elsewhere in the message flow, the message is routed to the catch terminal. If you have not connected nodes to the catch terminal, the node will backout message for re-delivery until the problem is resolved or the backout threshold is reached.

You must define a backout destination. If you do not define a backout destination, the node issues a bip4669 error message and stops processing further input.

Configuring for coordinated transactions

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

  • If you set it to global, the message is received under external syncpoint coordination, that is, within a WebSphere MQ unit of work. Any messages subsequently sent by an output node in the same instance of the message flow are put under syncpoint, unless the output node has explicitly overridden this.
  • If you set it to local, the message is received under the local syncpoint control of the JMSInput node. Any messages subsequently sent by an output node in the flow are not put under local syncpoint, unless an individual output node has specified that the message must be put under local syncpoint.
  • If you set it to none, the message is not received under syncpoint. Any messages subsequently sent by an output node in the flow are not put under syncpoint, unless an individual output node has specified 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 instance, on Distributed (non z/OS) platforms, the WebSphere MQ JMS provider supplies an extra jar file com.ibm,mqetclient.jar. This jar must also be added to the broker shared_classes directory. Refer to Making the JMS Provider client available to the JMS Nodes in this topic.

When messages are to be received under external syncpoint, additional configuration steps are required. These steps need only be applied the first time that a JMSOutput or JMSInput is deployed to the Broker for a particular JMS provider:
  • On distributed platforms, the external syncpoint coordinator for the broker is WebSphere MQ. Before you deploy a message flow in which the Transaction Coordination 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.
    • On Windows, if you have WebSphere MQ Version 5 installed, start WebSphere MQ Services, right-click the queue manager name. Select Properties and click the Resource properties tab. If you have WebSphere MQ Version 6 installed, start WebSphere MQ Explorer, right-click the queue manager name in the left pane. Select Properties and select XA resource managers in the left pane. Refer to the WebSphere MQ System Administration Guide for more information.
      Set the SwitchFile property to the following value:
      install_dir/bin/ JMSSwitch.dll  
      XAOpenString=Initial Context,location JNDI,Optional_parms
      ThreadOfControl=THREAD 
    • On Linux and UNIX platforms, add a stanza to the queue manager ini file for each JMS provider. Refer to the WebSphere MQ System Administration Guide for more information.
      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 file:/, iiop:/, or ldap:/
      The following parameters are optional:
      • LDAP Principal which matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands.
      • LDAP Credentials which matches the value that is set for the broker by using the mqsicreatebroker or mqsichangebroker commands.
      • Recovery Connection Factory Name which 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, in which the Switch File is located. For example:
        install_dir/bin

      XA cannot use the same queue manager for both the broker and the provider until WebSphere MQ Version 5.3, CSD12 and WebSphere MQ Version 6 FixPack 1.

    • 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.

Terminals and properties

The terminals of the JMSInput node are described in the following table.

Terminal Description
Failure The output terminal to which the message is routed if an error occurs. Even if the Validation property is set, messages 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 on the properties dialog 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 Basic properties of the JMSInput node are described in the following table.

Property M C Default Description
Initial Context Factory Yes   com.sun.jndi.fscontext.RefFSContextFactory This 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 which is used when WebSphere MQ Java is used as the JMS provider.

Location JNDI Bindings Yes     The system path or the LDAP location for the bindings file.
Connection Factory Name Yes     The name of the connection factory that is used by the JMSInput node to create a connection to the JMS provider.
Backout Destination No     The destination that is used by the JMSInput node when a message cannot be processed by the message flow because of errors in the message.
Backout Threshold No   0 The value that controls when a re-delivered message is put to the backout destination.

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

Property M C Default Description
Transaction Mode Yes No none This property is used to determine whether the incoming message is received under external syncpoint, local syncpoint, or out of syncpoint. Valid values are none, local, and global.

The Description properties of the JMSInput node are described in the following table.

Property M C Default Description
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.