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:

Write


Description:

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

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

[None]


Support and limitations:


Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See JMS Account 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 view when opted will write JMSCorrelationIDJMSMessageID property values of the message sent along with the original metadata 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. 

Default value: [None]

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

Destination type


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

  • QUEUE
  • TOPIC

Default value: QUEUE

Message type


Required. Type of MS message to be transmitted. The options available include:

  • 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 explanation of what these properties  are, see the section Message Properties at: http://docs.oracle.com/javaee/6/api/javax/jms/Message.html)

Following are the message properties that can be added:

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

This property when selected, a transacted session would be used to produce the message and the TransactionID would be included in the output.

Note

Transaction ID is applicable to the ActiveMQ only.


Default value: false

Multiexcerpt include macro
nameSnap Execution
pageSOAP Execute

Multiexcerpt include macro
nameExecution_Detail_Write
pageSOAP Execute


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.

Image Added

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:

Image Added

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:

Image Added

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

Attachments
patterns*.slp


Insert excerpt
JMS Snap Pack
JMS Snap Pack
nopaneltrue