JMSInput node

Use the JMSInput node to receive messages from JMS destinations. JMS destinations are accessed through a connection to a JMS provider.

This topic contains the following sections:

Purpose

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 contained in the JMS drawer of the palette, and is represented in the workbench by the following icon:

JMSInput node icon

Using the JMSInput node in a message flow

The following sample contains a message flow in which the JMSInput node is used. This sample is an example of how to use the JMSInput 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 an output node in a message flow that starts with a JMSInput node, it can be any of the supported output nodes (including user-defined output nodes); you do not need to include a 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.

Start of changeWhen you use 32-bit execution groups in a default 64-bit host environment, you must set the WebSphere® MQ JMS Java™ library paths on the MQSI_LIBPATH32. For example:
export MQSI_LIBPATH32=$MQSI_LIBPATH32:/usr/mqm/lib:/usr/mqm/java/lib
End of change
Restriction: When the JMSInput node receives publication topics, it 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

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.

To display one or more of the defined configurable services, use the mqsireportproperties command. The following example displays all configurable services that are available for a single broker:
mqsireportproperties brokerName -c AllTypes -o AllReportableEntityNames -r 
  • If you want to use the WebSphere MQ JMS provider, and you have installed WebSphere MQ in the default location on the broker 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 broker system.

    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 to 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 required service.

Connecting the terminals

For each message that is received successfully, the JMSInput node routes the message to the Out terminal. If this action fails, the message is retried. If the retry threshold is reached, where the threshold is defined by the Backout threshold property of the node, the message is routed to the Failure terminal. You can connect nodes to the Failure terminal to handle this condition.

If an exception occurs in the failure path, the path is retried until the number of attempts is twice the Backout threshold. If that limit is exceeded, the message is put to the Backout destination.

If you have not connected nodes to the Failure terminal, the message is written to the Backout destination. If you have not specified a Backout destination, the node issues a BIP4669 error message and stops processing further input.

If the message is caught by the JMSInput node after an exception has been generated 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 backs out messages for redelivery until the problem is resolved, or the Backout threshold is reached. 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 sync point.

  • If you set this property to Global, the message is received under external sync point 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 sync point, unless the output node overrides this setting explicitly.
  • If you set this property to Local, the message is received under the local sync point control of the JMSInput node. Any messages that are sent subsequently by an output node in the flow are not put under local sync point, unless an individual output node specifies that the message must be put under local sync point.
  • If you set this property to None, the message is not received under sync point. Any messages that are sent subsequently by an output node in the flow are not put under sync point, unless an individual output node specifies that the message must be put under sync point.
To receive messages under external sync point, you must take additional configuration steps, which need be applied only the first time that a JMSOutput or JMSInput node is deployed to the broker for a particular JMS provider.
  • On distributed systems, the external sync point coordinator for the broker is WebSphere MQ. Before you deploy a message flow in which the Transaction mode property 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 
      For more information, see the System Administration Guide section of the WebSphere MQ Version 6 information center online, or the Version 5.3 book on the WebSphere MQ library Web page.
    • Linux platformUNIX platform On Linux® and UNIX® systems, add a stanza to the queue manager .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.
      XAOpenString can have the following values:
      • Initial Context is the value that is set in the JMSInput node property Initial context factory.
      • location JNDI is the value that is set in the JMSInput node property Location JNDI bindings. This value must include the leading keyword, which is one of 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, you must add a default value for recoverXAQCF to the bindings file. In either case, the Recovery Connection Factory must 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 SwitchFile is located; for example:
        install_dir/bin

    For more information, see the System Administration Guide section of the WebSphere MQ Version 6 information center online, or the Version 5.3 book on the WebSphere MQ library Web page.

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

    To use the same queue manager for both the broker and the JMS provider, ensure that your WebSphere MQ installation is at the minimum required level: 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 sync point 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.

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

Terminals and properties

When you have put an instance of the JMSInput 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. To display the properties of the node in the Properties dialog, either double-click the node, or right-click the node and click Properties. All mandatory properties that do not have a default value defined are marked with an asterisk.

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 that are propagated to this terminal are not validated.
Out The output terminal to which the message is routed if it is retrieved successfully.
Catch The output terminal to which the message is routed if an exception is generated 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 JMSInput node are described in the following table.
Property M C Default Description
Node name No No The node type, JMSInput 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 JMSInput node are described in the following table.
Property M C Default Description
Initial context factory Yes Yes com.sun.jndi.fscontext. RefFSContextFactory The starting point for a JNDI name space.

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, see the JMS provider documentation.

Location JNDI bindings Yes 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 JMSInput 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 JMSInput 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 the LDAP principal (userid) and LDAP credentials (password) separately. These values are configured at broker level. For information about configuring these values, see mqsicreatebroker command and mqsichangebroker command.
  • The string value must include the leading keyword, which must be one of the following options:
    • file://
    • iiop://
    • ldap://

For information about constructing the JNDI administered objects bindings file, see the JMS provider documentation.

Connection factory name Yes Yes   The name of the connection factory that is used by the JMSInput node to create a connection to the JMS provider. This name must already exist in the bindings file.
Backout destination No Yes   The JMSInput node sends input messages 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.
Backout threshold No Yes 0 The value that controls when a redelivered 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 Advanced properties of the JMSInput node are described in the following table.
Property M C Default Description
Transaction mode Yes No none This property controls whether the incoming message is received under external sync point, local sync point, or out of sync point.
  • 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 must coordinate the commit or roll back of JMS messages that are 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 must participate in a global message flow transaction that is managed by the broker's external sync point coordinator. The sync point 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.
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009. All Rights Reserved.
Last updated : 2009-01-07 15:39:55

ac24820_