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.
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 |
|---|---|---|---|---|
Input | Document
|
|
| This Snap has at most one optional document input view. |
Output | Document
|
|
| 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:
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 |
|---|---|
Label
| 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
| A Boolean property to make the JMS Consumer Snap a durable subscriber. |
Client ID
| 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
| 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
| Required. The Java Naming and Directory Interface (JNDI) lookup name of the regular JMS destination. This destination is used to fetch regular JMS messages.
Example:
|
Control destination
| Required. The JNDI lookup name of the control JMS destination. Example: JMSTestServer@JNDIContextPath The values can be passed dynamically using the pipeline parameters but not via the upstream. |
Destination type
| A type of JMS destination. Valid options are:
Default value: Queue |
Message selector
| 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:
|
Execution timeout (seconds)
| 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.
Default Value: 0 |
Message count
| 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
| A message acknowledgment mode for non-transacted sessions. Valid options are:
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
| 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 Default value: Selected Example: Deselected (for a Solace client profile with transacted sessions turned off) |
Processing mode
| A mode of message processing (Synchronous or Asynchronous).
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
| Select one of the following three modes in which the Snap executes:
Default Value: Execute only |
Example
Guaranteed Delivery with JMS Snaps
To achieve guaranteed delivery in a JMS Snap pipeline:
Start JMS Consumer with Message Acknowledge mode as CLIENT_ACKNOWLEDGE and Processing mode as Synchronous.
Attach a JMS Acknowledge Snap at the end of the pipeline.
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.