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 messages from a RabbitMQ destination and acknowledges them.

  • Expected upstream Snaps: Upstream Snap is optional. Any Snap with a document output view can be connected upstream.
  • Expected downstream Snaps: Any Snap with a binary input view can be connected downstream, e.g. File Writer, CSV Parser, JSON Parser, XML Parser, etc.
  • Expected input: The Snap does not require input data. Input documents may be used to evaluate any JavaScript expression in the File property.
  • Expected output: Message consumed from RabbitMQ server as binary document.
Prerequisites:
  • Access to the RabbitMQ Server.
  • Privileges to perform various actions on the Queues such as receive and send messages.
Support and limitations:Works in Ultra Task Pipelines.
Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring RabbitMQ 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 binary 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.

Exchange



Conditional. Name of the RabbitMQ exchange bound to the queue. If the exchange is not specified, then the default exchange provided by RabbitMQ is considered.

Note

Either Exchange or Queue has to be specified.


Exchange type

The type of RabbitMQ exchange used to push messages. Options available include:

  • direct: Routes the messages to the queues only on matching with the routing key.
  • fanout: Routes the messages to the queues that are bound to it regardless of the routing keys and patterns.
  • headers: Routes the messages to the queues based on header values as specified in the binding. Provide the x-match and Header Properties if selected.

  • topic: Routes the messages to the queues based on the routing key and the binding pattern.

Default value: direct


Durable Exchange

Whether or not the exchange is durable.

Default Value: Selected

Queue


Conditional. Name of the RabbitMQ queue from which messages have to be consumed. If there is no queue with given queue name on RabbitMQ, then a new queue is created and consumer starts listening. If the exchange name and routing key are also specified, then the queue is bound to the exchange with given routing key.

Note

Either Exchange or Queue has to be specified.


Auto delete

Select this check box to indicate that the RabbitMQ autoDelete property associated with the existing queue is set to true.

Default value: Deselected.

Routing Key


Routing key to be used for binding the queue with the exchange


Processing Mode


Specifies the mode of message processing. The options available include Synchronous and Asynchronous.

Synchronous: When in synchronous mode, the consumer will process messages from the destination one at a time until a STOP is read or the Message Count is reached.

Note

If a message is not available, the consumer will retry for an available message at an interval of every 3 secs until the Message count is reached.

For example, if the Queue sends 8 messages, and the Message count is set to 10, the consumer processes the 8 messages one after the other, and sleeps for every 3 seconds for the remaining two unavailable messages.

Asynchronous: When in asynchronous mode, the consumer reads the messages from the destination whenever the message arrives until a 'STOP' is read or the Message Count is reached. The consumer registers a messagelistener asynchronously. It does not block, but calls (the processmessage) immediately once a message is available.

Default value: Synchronous


Message Acknowledge Mode


Required. Specifies the mode of message acknowledgement for non-transacted sessions. The available 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.

PIPELINE_CONTROL- the client has the power when to acknowledge the message.  

Note

Select the PIPELINE_CONTROL option when using the RabbitMQ Acknowledge Snap in a pipeline.

  1. The RabbitMQ Consumer Snap writes the messages to the output view along with headers containing a DeliveryTag which is then forwarded to the RabbitMQ Acknowledge Snap. 
  2. The RabbitMQ Acknowledge Snap may be positioned anywhere in the pipeline following the Consumer Snap. The RabbitMQ Acknowledge Snap should be configured with necessary acknowledgement mode based on message processing. Options available are Acknowledge, Reject and Recover. 

Default valueAUTO_ACKNOWLEDGE

x-match


Specifies the x-match value to be submitted for binding. The available options are:

  • any : If selected, even one matching header value is sufficient
  • all : If selected, mandates that all the values should match 

Default value: all

Note

Select x-match only when the Exchange type is header


Header properties


Specifies the header properties that will be used to bind the queue with an exchange as arguments.  

Note

Configure Header properties only when the Exchange type is headers.

Only one Header can be specified in each row. Click  to add a new row in this table and specify the values accordingly.

This fieldset comprises the following fields:

  • Header key
  • Header value 

Header key


Specifies the name of the header that is being used for the binding.


Header value


Specifies the header value corresponding to the respective header key.

Argument properties

Specifies the custom argument properties to ensure all declarations for the queues use the same configuration/options/arguments.  

Only one argument can be specified in each row. Click  to add a new row in this table and specify the values accordingly.

This fieldset comprises the following fields:

  • Argument key
  • Argument value 
           Argument key

Specifies the name of the argument used for declaration. See Optional Arguments in RabbitMQ documentation for more information.

Example: x-max-len-bytes, x-max-priority

Default value: None.

           Argument value

Specifies the value corresponding to the argument key.

Example: 1048576, 2

Default value: None.

Message Count


Controls the number of messages to be consumed from the destination queue before the consumer is stopped. Negative integer value will make the consumer run indefinitely.

Possible values include:

  • Negative integers: The consumer will run in a never ending loop and keeps consuming messages from the destination. This is a default behavior.
Info

The Consumer Snap processes one document only when the Message Count property is configured to a negative integer (for example, -1).

  • Value 0: Consumes all the messages from the destination and then stops.
  • Value greater than 0: The consumer will consume the specified number of messages before stopping.

Default value: -1


Maximum connection attempts

The maximum number of connection attempts in case of a connection failure. The Snap retries for the configured number of attempts for establishing the connection.

If it exceeds the configured value, and the Route connection errors property is enabled, the messages are routed to the error view with the error information along with the original.

When the Route connection errors property is disabled, the Snap displays the number of published messages along with the error information, however, the Snap fails.

Default value: 3

Connection retry intervalThe time taken in seconds to wait before retrying for another connection.

Default value: 10

Route connection errors

If enabled, the Snap routes the connection errors to the error view displaying the error information along with the original.

If disabled, the Snap fails to execute.

Default value: Not selected

Snap Execution

Indicates how the Snap must be executed. Available options are:

  • Validate & Execute: Performs limited execution of the Snap (up to 50 records) during Pipeline validation; performs full execution of the Snap (unlimited records) during Pipeline execution.
  • Execute only: Performs full execution of the Snap during Pipeline execution; does not execute the Snap during Pipeline validation.
  • Disabled: Disables the Snap and, by extension, its downstream Snaps.

Default value: Validate & Execute

Multiexcerpt include macro
nameSnap Execution
pageAnaplan Read

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

Examples



Expand
titleRabbitMQ Consumer Snap consumes the messages from a specified queue

In this pipeline, the RabbitMQ Consumer Snap consumes the messages from a specified queue and writes them to the output view.

The RabbitMQ Consumer Snap, consumes the messages from the queue 'DemoQueue' either in synchronous or asynchronous mode.

Note that the Consumer creates the Exchange and Queue if they are not available in the RabbitMQ server, and binds them based on the properties configured such as Routing keyHeader Properties, x-match etc., and then starts consuming the messages from the server.

Successful execution of the pipeline displays the message properties in the output preview:



Expand
titleRabbitMQ Consumer Snap reads and sends messages to the CRM instance

In the below pipeline, the RabbitMQ Consumer Snap reads the messages from a queue and sends them to the CRM instance. The JSON Parser parses the messages and maps the messages to the CRM instance. The Script Snap is configured for a time delay so all the messages configured in the queue are processed.


Insert excerpt
RabbitMQ Snap Pack
RabbitMQ Snap Pack
nopaneltrue