Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

Snap type:

Read


Description:

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

Prerequisites:

N/A


Support and limitations:
  • Works in Ultra Task Pipelines.
  • Processes only the following types of messages:
    • TEXT
    • MAP
    • BYTE
    • STREAM
      For any other message type, the Snap throws the exception – Unsupported Format.
Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring JMS Accounts for information on setting up this type of account.


Views:


InputThis Snap has at most one optional document input view.
OutputThis Snap has exactly one document output view.
ErrorThis Snap has at most one document error view and produces zero or more documents in the view.


Settings

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


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

Note

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.

ExampleTestSubscription

Note

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.

Note

This destination is used to fetch regular JMS messages.


Note
  • 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 as well as the name of the module associated with the queue/topic. Use the following format:

    Paste code macro
    <module_name>!<queue_name>
    
    <module_name>!<topic_name>


Example

  • TestQueue
  • testmodule!testqueue
  • testmodule!testtopic

Control Destination


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.

ExampleTestControl

Note

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:

  • Queue
  • Topic

Default valueQueue

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.

Note

The SQS account does not support Message selector 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

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.

Message Acknowledge Mode


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 receive method or when the message listener returns successfully.
  • CLIENT_ACKNOWLEDGE - the client has the power when to acknowledge the message.
  • DUPS_OK_ACKNOWLEDGE - the session lazily acknowledges the delivery of messages, possibly resulting 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

ExampleAUTO_ACKNOWLEDGE

Processing Mode


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 valueSynchronous

Number of retries

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

Example3

Default value0

Retry interval (milliseconds)

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

Example1500

Default value1000

Multiexcerpt include macro
nameSnap Execution
pageAnaplan Read


Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

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.

Insert excerpt
JMS Snap Pack
JMS Snap Pack
nopaneltrue