JMS Consumer

JMS Consumer

On this Page

This page is no longer maintained (October 14, 2026). To access the most current version, go to https://docs.snaplogic.com/snaps/sp-jms/snap-jms-consumer.html

Overview

This Snap fetches the Java Message Service (JMS) messages from a JMS destination and acknowledges them.

image-20260929-182049.png

Support for Ultra Pipelines 

Works in Ultra Pipelines. 

Limitations and Known Issues

  • Processes only the following types of messages:

    • TEXT

    • MAP

    • BYTE

    • STREAM
      For any other message type, the Snap throws the exception – Unsupported Format.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

 

  • Min: 0

  • Max: 1

  • Mapper

  • CSV Formatter

  • JSON Formatter

  • XML Formatter

This Snap has at most one optional document input view.

Output

Document

 

  • Min: 1

  • Max: 1

  • Mapper

  • Copy

  • JSON Formatter and File Writer

This Snap has exactly one document output view.

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon ( ): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ( ): Indicates that you can add fields in the field set.

  • Remove icon (): Indicates that you can remove fields from the field set.

Field

Description

Field

Description

Label

String

 

Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Durable subscriber

Checkbox

 

 

A Boolean property to make the JMS Consumer Snap a durable subscriber.
A durable subscriber consumer wants to receives the messages that were sent when the subscriber is disconnected from the messaging system, requiring the messaging provider to cache publications until the subscriber is back up.

Client ID

String/Expression

 

Required. A client ID to be applied to the JMS connection inside this JMS consumer. (This property is only used if Durable Subscriber is checked).

Example: 0001

The values can be passed dynamically using the pipeline parameters but not via the upstream.

Subscription name

String/Expression

 

Required. The name of the subscription to be used if Durable Subscriber is checked.

Example: TestSubscription

The values can be passed dynamically using the pipeline parameters but not via the upstream.

Destination

String/Expression

 

Required. The Java Naming and Directory Interface (JNDI) lookup name of the regular JMS destination.

This destination is used to fetch regular JMS messages.

  • The topic/queue name specified is case sensitive. Ensure that the letter case for Destination is the same in the Producer and Consumer Snaps.

  • If the topic/queue name does not exist at the Java Message Service client (such as ActiveMQ), one will automatically be created with that name.

  • When using Weblogic JMS Server, you must provide queue/topic name, the name of the module associated with the queue/topic, and the Weblogic JMS server where the queue/topic is hosted. Use the following format: 

    Better code block

Example: 

  • testserver/TestQueue

  • testserver/testmodule!testqueue

  • testserver/testmodule!testtopic

  • JMSserver-1/SystemModule-0!Queue-1

Control destination

String/Expression

 

Required. The JNDI lookup name of the control JMS destination.
Note:  This destination is used to fetch control JMS messages to stop this JMS consumer from fetching regular JMS messages. The destination must be specified with the JMS Server Name and JNDI context path. Specify the destination in this format: JMS_Server_Name@JNDI_context_path

Example: JMSTestServer@JNDIContextPath

The values can be passed dynamically using the pipeline parameters but not via the upstream.

Destination type

String/Expression

 

A type of JMS destination. Valid options are:

  • Queue

  • Topic

Default value: Queue
Example: Topic

Message selector

String/Expression

 

A SQL92 style expression to filter the JMS messages. The message selector value can be used to filter the messages from the destination, but cannot reference the message body. A message that evaluates the expression as true will pass on to the consumer. See your providers documentation for supported expressions.

The SQS account does not support Message Selector values—it expects the value to be null. Learn more: Support for Message selectors.

Example:

  • JMSCorrelationID='1', will read messages with JMSCorrelationID value set as '1' from destination.

  • user IS NOT NULL

Execution timeout (seconds)

Integer/Expression

The maximum time, in seconds, the Snap waits for execution to complete. If the time exceeds, the Snap stops processing and completes execution. The default value 0 indicates no timeout.

  • If the Execution timeout is greater than 0, the Snap stops consuming after the specified timeout is reached, even if the Message count threshold is not met. For example, if the Execution timeout is 100 seconds and the Message count is 200, the Snap stops execution after 100 seconds and exits gracefully, even if it does not process 200 messages within 100 seconds.

Default Value: 0
Example: 30

Message count

String/Expression

Maximum messages to read before execution stops. A negative value will make this JMS Consumer run indefinitely. Set to zero to consume all the messages in the destination queue/topic and then exit.

When you validate the Snap, the Snap consumes only one message irrespective of the value in the Message Count.

Default value: -1 (when this Snap has no input views) or 1 (when the Snap has an input view).

Message acknowledge mode

Checkbox

 

A message acknowledgment mode for non-transacted sessions. Valid options are:

  • AUTO_ACKNOWLEDGE - the session acknowledges the receipt of a message when a call to the receive method or when the message listener returns successfully.

  • CLIENT_ACKNOWLEDGE - the client chooses when to acknowledge the message. The Transacted session checkbox appears.

  • DUPS_OK_ACKNOWLEDGE - the session lazily acknowledges message delivery. This may result in duplicate messages if the JMS provider fails.

For a description of these modes, go to http://docs.oracle.com/javaee/6/tutorial/doc/bncfu.html#bncfw

Default value: AUTO_ACKNOWLEDGE

Example: CLIENT_ACKNOWLEDGE

Transacted session

Checkbox

Appears when you select CLIENT_ACKNOWLEDGE in Message acknowledge mode.

You can let the Snap use a transacted session with the JMS provider. Deselect it if your JMS provider doesn't support transacted sessions. For example, a Solace client profile where transacted sessions are turned off. The Snap then uses a non-transacted session, and messages are still acknowledged.

If this checkbox is selected and the provider doesn't support transacted sessions, the Snap fails with an error such as Capability Mismatch: Router does not support transacted sessions.

Default value: Selected

Example: Deselected (for a Solace client profile with transacted sessions turned off)

Processing mode

Dropdown list

 

A mode of message processing (Synchronous or Asynchronous).

  • Synchronous mode will make the consumer read the messages from the destination every 5 seconds until a 'STOP' is read or the Message Count is reached. If the consumer reads the message within 5 seconds, then it will process it and not wait every 5 seconds for the next message.

  • Asynchronous mode will make the consumer read the message from the destination when ever the message arrives until a 'STOP' is read or the Message Count is reached. 

Default value: Synchronous

Number of retries

Integer

The maximum number of attempts the Snap must make to fetch JMS messages when there is a network failure.

Default value: 0

Example: 3

Retry interval (milliseconds)

Integer

The minimum time in milliseconds for which the Snap must wait before attempting recovery from a network failure.

Default value: 1000

Example: 1500

Snap execution

Dropdown list

Select one of the following three modes in which the Snap executes:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default Value: Execute only
Example: Validate & Execute

Example

Guaranteed Delivery with JMS Snaps

To achieve guaranteed delivery in a JMS Snap pipeline:

  1. Start JMS Consumer with Message Acknowledge mode as CLIENT_ACKNOWLEDGE and Processing mode as Synchronous.

  2. Attach a JMS Acknowledge Snap at the end of the pipeline.

  3. The JMS Consumer will have 'JMS MessageID' passed in the header of binary document. Pass this value as the document input to JMS Acknowledge Snap.

When the pipeline starts, the consumed message is written to the output view by the JMS Consumer Snap and passed downstream for further processing. Consumer keeps waiting for a response from Acknowledge Snap. When all the processing is completed, the JMS Acknowledge at the end of pipeline will intimate JMS Consumer to acknowledge the specified message (message is identified by JMS Message ID passed) and then the JMS Consumer acknowledges the message and continues reading the next message and so on.