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: |
| |||||||
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.Â
Example:Â
| |||||||
Destination type | Required. The Type of JMS destination based on how the Destination property was configured. Valid options are:Â
Default value: QUEUE | |||||||
Message type | Required. Type of MS message to be transmitted. Valid options are:
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:
| |||||||
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: 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
Snap Pack History
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.