JMS Producer

On this Page

Snap type:

Write

Description:

This Snap creates JMS messages from incoming JSON documents and puts them into a JMS destination.

If you are planning to use Delay and Schedule Message Delivery feature in Apache ActiveMQ (http://activemq.apache.org/delay-and-schedule-message-delivery.html), you must set the schedulerSupport attribute to true in broker configuration, which can be found in $ACTIVEMQ_HOME/conf/activemq.xml.
Prerequisites:

N/A


Support:Works in Ultra Tasks.
Limitations:Typically, in all message streaming applications, when a message is put in a nonexisting queue or topic, the JMS Producer Snap creates a queue in the destination. However, in the IBM MQ application, Snap checks for the queue in the destination, and then puts the message; if a queue does not exist, Snap displays an error. Therefore, you must create a queue in IBM MQ before putting a message.
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 exactly one binary input view. If the upstream Snap generates a document in its output you must use corresponding formatting Snaps to convert the input data into a binary format. 
OutputThis Snap has at most one document output view. The output includes the original metadata, JMSCorrelationID, and JMSMessageID along with any other parameters specified in the Message properties field.
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.

Destination



Required. The queue or topic to which the message is to be sent. 

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

Example: 

  • TestQueue
  • testmodule!testqueue
  • testmodule!testtopic

Destination type


Required. The Type of JMS destination based on how the Destination property was configured. Valid options are: 

  • QUEUE
  • TOPIC

Default value: QUEUE

Message type


Required. Type of MS message to be transmitted. Valid options are:

  • TEXT: a string message type.
  • BYTE: a raw stream of bytes.
  • STREAM: a serialized stream of objects.
  • MAP: name/value pairs. This data is unordered and each name must be unique.

Default value: TEXT

Message properties


Properties to be set in JMS messages (For details about these properties, see the section Message Properties at http://docs.oracle.com/javaee/6/api/javax/jms/Message.html)

You can add the following message properties:

  • JMSDestination
  • JMSDeliveryMode
  • JMSExpiration
  • JMSPriority
  • JMSMessageID
  • JMSTimestamp
  • JMSCorrelationID
  • JMSType
  • JMSRedelivered
Transacted session

This property when selected, a transacted session is used to produce the message and the TransactionID is added to the output.

Transaction ID is applicable to the ActiveMQ only.


Default value: false

Number of retries

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

Example: 3

Default value: 0

Retry interval (milliseconds)

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

Example: 1500

Default value: 1000

Snap execution

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


Examples


Reading Message Data from JSON 1

This example demonstrates how you can use the JMS Producer Snap to read data from a JSON file and add the data into the message queue.

The sample input data consists of employee records. The JSON Generator Snap generates them as a JSON document. The following image shows a preview of the output from the JSON Generator Snap:

Since the JMS Producer Snap accepts only binary inputs, the JSON Formatter Snap is used between the JSON Generator and JMS Producer Snaps.

The following image shows the configuration of the JMS Producer Snap:

On successful execution, all the data is placed in the messaging queue. 

Download this Pipeline.

Reading Message Data from JSON File 2

The below pipeline creates the messages from the incoming binary format and displays the output view on executing successfully.   






In the Snap settings, the Transacted Session property is selected and hence the output view displays the Transaction ID that can validated on the JMS console.

Downloads

Important steps to successfully reuse Pipelines

  1. Download and import the pipeline into the SnapLogic application.
  2. Configure Snap accounts as applicable.
  3. Provide pipeline parameters as applicable.

  File Modified

File Example_JMS_Producer.slp

Feb 28, 2022 by Subhajit Sengupta

Snap Pack History

 Click to view/expand
ReleaseSnap Pack VersionDateTypeUpdates
November 2024439patches29329 LatestFixed an issue with the JMS Consumer Snap that displays ExecutionException when the Snap captures a connection error. Now, it routes the connection error to the error view.
November 2024main29029 StableUpdated and certified against the current SnapLogic Platform release.
August 2024main27765 StableUpdated and certified against the current SnapLogic Platform release.
May 2024main26341 StableUpdated and certified against the current SnapLogic Platform release.
February 2024main25112 StableUpdated and certified against the current SnapLogic Platform release.
November 2023main23721 StableUpdated and certified against the current SnapLogic Platform release.
August 2023main22460 StableUpdated and certified against the current SnapLogic Platform release.

May 2023

main21015 

Stable

Upgraded with the latest SnapLogic Platform release.

February 2023432patches20479 Latest

Fixed an issue where the JMS Producer Snap was previously only writing headers to the WebLogic queue. Now the Snap writes the entire document.

February 2023main19844 StableUpgraded with the latest SnapLogic Platform release.
November 2022main18944 StableUpgraded with the latest SnapLogic Platform release.
August 2022main17386 StableUpgraded with the latest SnapLogic Platform release.
4.29main15993 StableUpgraded with the latest SnapLogic Platform release.
4.28main14627 StableUpgraded with the latest SnapLogic Platform release.

4.27

main12833

 

Stable

Upgraded with the latest SnapLogic Platform release.
4.26main11181 StableUpgraded with the latest SnapLogic Platform release.
4.25main9554
 
Stable

Upgraded with the latest SnapLogic Platform release.

4.24 Patch4.24patches9098 Latest

Enhances the JMS account in the JMS Snap Pack by updating the JNDI properties (java.naming.security.principal, java.naming.security.credentials) with username and password, to support the requirements of certain JMS servers.

4.24 Patch424patches9104 Latest

Fixes an issue in the JMS Consumer Snap, where different JMS SQS accounts interfere with each other while running on the same jcc node by using the AWSStaticCredentialProvider instead of the SystemPropertiesCredentialsProvider.

4.24main8556
StableUpgraded with the latest SnapLogic Platform release.
4.23main7430
 
StableUpgraded with the latest SnapLogic Platform release.
4.22 Patch422patches6992 Latest

Fixes the JMS Snap Pack by replacing JMS class loader for Oracle AQ (Advance Queuing).

4.22main6403
 
StableUpgraded with the latest SnapLogic Platform release.
4.21snapsmrc542

 

StableUpgraded with the latest SnapLogic Platform release.
4.20 Patch  jms8824 Latest

Fixes an issue in the JMS Consumer Snap due to which the Snap does not release the memory even after Pipeline termination, leading to huge memory spikes.

4.20 Patch jms8810 Latest

Fixes the connection leak issue in the JMS Producer Snap.

4.20 Patch jms8765 Latest

Fixes an issue with the JMS Consumer Snap that fails to successfully create durable subscribers when run in asynchronous mode.

4.20snapsmrc535
 
StableUpgraded with the latest SnapLogic Platform release.
4.19 Patch jms8420 Latest
  • Adds the following properties to the JMS Consumer and JMS Producer Snaps to enable retry and reconnect features:
    • Number of retries: Defines the number of times the Snap must re-attempt an operation before throwing a connection/network error.
    • Retry interval (milliseconds): Defines the time in milliseconds the Snap must wait between subsequent retries upon a connection/network error.
  • Enables the JMS Producer Snap to clean up stale connections.
  • Fixes the JMS Acknowledge Snap where the Snap fails unexpectedly without providing a reason.
4.19snaprsmrc528
 
StableUpgraded with the latest SnapLogic Platform release.
4.18 Patch jms7865 Latest

Fixed an issue with the JMS Consumer Snap that reinserts failed messages in the JMS queue without checking for duplicate messages.

4.18snapsmrc523
 
StableUpgraded with the latest SnapLogic Platform release.
4.17ALL7402
 
Latest

Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.

4.17snapsmrc515
 
Latest

Added the Snap Execution field to all Standard-mode Snaps. In some Snaps, this field replaces the existing Execute during preview check box.

4.16snapsmrc508
 
StableUpgraded with the latest SnapLogic Platform release.
4.15snapsmrc500
 
Stable

Added HornetQ support for the JMS Producer and JMS Consumer Snaps.

4.14snapsmrc490
 
StableUpgraded with the latest SnapLogic Platform release.
4.13

snapsmrc486

 
StableUpgraded with the latest SnapLogic Platform release.
4.12

snapsmrc480

 
StableUpgraded with the latest SnapLogic Platform release.
4.11snapsmrc465
 
StableUpgraded with the latest SnapLogic Platform release.
4.10

snapsmrc414

 
StableUpgraded with the latest SnapLogic Platform release.
4.9 Patch jms3305 Latest

Elegant error & resolution messaging for bad ConnectionFactory and bad connectionFactoryNames JNDI property

4.9snapsmrc405
 
StableUpgraded with the latest SnapLogic Platform release.
4.8 Patch jms2702  Latest

Addressed an issue with the JMS Acknowledge Snap failing to exit in Ultra mode.

4.8 Patchjms2883 Latest

Addressed multiple issues regarding messages being consumed or acknowledged in JMS Consumer and Acknowledge Snaps.

4.8

snapsmrc398

 
StableUpgraded with the latest SnapLogic Platform release.
4.7

snapsmrc382

 
StableUpgraded with the latest SnapLogic Platform release.
4.6snapsmrc362
 
StableUpgraded with the latest SnapLogic Platform release.
4.5.1

snapsmrc344

 
StableUpgraded with the latest SnapLogic Platform release.
4.5

snapsmrc344

Stable
  • Resolved an issue in JMS Consumer Snap that occurred when the Snap is set with the SQS account on a client_acknowledge mode.
  • Resolved an issue in JMS Consumer Snap that occurred when the Snap was used in the middle of a pipeline.
4.4
 Stable
  • JMS Producer: The file header is now passed through to the output view.
  • JMS Acknowledge: JMS MessageID is now optional for the input.
  • JMS Consumer: Expressions are now supported for Client ID and Subscription Name.