JMS Consumer

Overview

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


JMS Consumer Snap overview

Supported Accounts

Prerequisites

  • A valid account with the required permissions.

Limitations

  • 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 Description Examples of upstream and downstream Snaps
Input
  • Min: 0
  • Max: 1

This Snap has at most one optional document input view.

Output
  • Min: 1
  • Max: 1

This Snap has exactly one document output view.

Learn more about Error handling.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description
Label*

String

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.

Default value: N/A

Example: JMS Consumer
Durable Subscriber

Checkbox

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

Default value: Not selected

Client ID*

String/Expression

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

Default value: N/A

Example: 0001
Note: The values can be passed dynamically using the pipeline parameters but not via the upstream.
Subscription Name*

String/Expression

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

Default value: N/A

Example: TestSubscription
Note: The values can be passed dynamically using the pipeline parameters but not via the upstream.
Destination*

String/Expression

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, 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:
    servername/<module_name>!<queue_name>
    
    testserver/<module_name>!<topic_name>

Example:

  • testserver/TestQueue
  • testserver/testmodule!testqueue
  • testserver/testmodule!testtopic
  • JMSserver-1/SystemModule-0!Queue-1
Control Destination*

String/Expression

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

Default value: N/A

Example: JMSTestServer@JNDIContextPath
Note: The values can be passed dynamically using the pipeline parameters but not via the upstream.
Destination Type

Dropdown list

Optional. A type of JMS destination. Valid options are:

  • Queue
  • Topic

Default value: Queue

Example: Topic
Message Selector

String/Expression

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

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

Integer/Expression

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

Note: 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

Dropdown list

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

Default value: N/A

Example: AUTO_ACKNOWLEDGE
Processing Mode

Dropdown list

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

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

Optional. 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
Choose one of the three modes in which the Snap executes. Available options are:
  • 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.

Temporary files

During execution, data processing on Snaplex nodes occurs principally in-memory as streaming and is unencrypted. When processing larger datasets that exceed the available compute memory, the Snap writes unencrypted pipeline data to local storage to optimize the performance. These temporary files are deleted when the pipeline execution completes. You can configure the temporary data's location in the Global properties table of the Snaplex node properties, which can also help avoid pipeline errors because of the unavailability of space. Learn more about Temporary Folder in Configuration Options.

Examples

See JMS Snap Pack examples.