RabbitMQ Consumer

On this Page

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.

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.

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.

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.  

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

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.  

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.

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

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



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

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

Snap Pack History

 Click to view/expand
Release Snap Pack VersionDateType  Updates

4.27

main12833

 

Stable

Upgraded with the latest SnapLogic Platform release.
4.26 Patch426patches11770LatestEnhanced the Rabbit MQ Account with a new checkbox Cluster Support that enables multiple cluster node support for RabbitMQ Consumer and RabbitMQ Producer Snaps. You can select this checkbox to enable high availability of clusters by adding multiple hosts (Host name and Port) for each cluster node.
4.26main11181 StableUpgraded with the latest SnapLogic Platform release.
4.25main9554
 
StableUpgraded with the latest SnapLogic Platform release.
4.24 Patch 424 patches8750 Latest

Fixed the handling of RabbitMQ Headers in the RabbitMQ Consumer Snap, including the x-death header.

4.24main8556
StableUpgraded with the latest SnapLogic Platform release.
4.23main7430
 
StableUpgraded with the latest SnapLogic Platform release.
4.22main6403
 
Stable

Enhances the RabbitMQ Consumer and RabbitMQ Producer Snaps to allow defining custom arguments to ensure that all declarations for the queues use the same configuration/options/arguments. 

4.21snapsmrc542

 

StableUpgraded with the latest SnapLogic Platform release.
4.20snapsmrc535
 
StableUpgraded with the latest SnapLogic Platform release.
4.19snaprsmrc528
 
Stable

Added the Auto delete check box, which enables you to indicate that the RabbitMQ autoDelete property associated with the existing queue is set totrue.

4.18 Patch rabbitmq8058 Latest

Fixed an issue with RabbitMQ Snaps wherein the Snaps throw an error when the auto-delete setting is set to true.

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
 
StableUpgraded with the latest SnapLogic Platform release.
4.14snapsmrc490
 
StableUpgraded with the latest SnapLogic Platform release.
4.13 Patch rabbitmq5296 Latest

Fixed the RabbitMQ Acknowledge Snap that returns a NullPointerException error when no DeliveryTag is sent during pipeline execution. 

4.13

snapsmrc486

 
Stable
  • Added a new Snap, the RabbitMQ Acknowledge Snap to perform an acknowledge, reject or a recover action on the received message from the RabbitMQ server.
  • Added a new property “Message Acknowledge Mode” in the RabbitMQ Consumer Snap to specify the mode of message acknowledgement -- Auto Acknowledge or Pipeline Control (if the RabbitMQ Acknowledge Snap is used).
4.12

snapsmrc480

 
Stable
  • Added a new RabbitMQ Producer Snap setting to customize the wait-for-confirms timeout window.
  • Fixed an issue that prevented a clean connection recovery in the RabbitMQ Producer when a previous connection attempt failed and exhausted the retry attempts.
4.11 Patch rabbitmq4653 

Fixed an issue with the RabbitMQ Retry Mechanism that fails to process after failure.

4.11 Patch rabbitmq4613 

Added the RabbitMQ Producer Snap with property 'Wait for confirms timeout (ms)' to enable the user to configure the publish timeout in milliseconds.

4.11 Patch rabbitmq4535 

Enhanced the RabbitMQ Producer and Consumer for connection retry logic when running in Ultra Pipelines.

4.11 Patch  rabbitmq4465 

Fixed an issue with the RabbitMQ Producer where dynamic queues were created for each instance of an Ultra Pipeline. The property Create dynamic queue is added as a part of the fix.

4.11 Patch rabbitmq4423 

Fixed an issue with the RabbitMQ Producer Snap that now creates dynamic queue for each message received.

4.11 Patch rabbitmq4324 

Fixed the following issues:

  • The RabbitMQ Snap, which failed, throwing a connection timeout error instead of trying to reconnect.
  • Issue with the Consumer Snap errors not going through error view.
  • Ultra Task Snap loaded the same document onto the RabbitMQ queue five times.
  • Ultra Task Snap, on an error logic retry, loaded the same document onto the RabbitMQ Producer Snap.
  • Inability to specify input variable for Routing key.
4.11snapsmrc465
 
StableUpgraded with the latest SnapLogic Platform release.

4.10 Patch 

rabbitmq4094

 

Fixed an issue related to messages being processed multiple times under certain failure conditions with Ultra pipelines. Added additional timeout conditions to the retry/error view handling.

4.10 Patch 

rabbitmq3860

 

Fixed an issue in Retrying.The configuration for retrying can be provided in Producer and Consumer Snaps individually.

4.10

snapsmrc414

 
Stable
  • The Message count property updated to a default value of -1.
  • Added the Producer Snap with Retry request interval and Maximum request attempts fields to support the retry logic in case of a network failure.
  • Added support to the RabbitMQ Account with the Use TLSv1.2,Trust all certificates, Key Store, TrustStore, Key/Truststore password and Key alias properties to support the SSL/TLS for secured communications.
4.9snapsmrc405
 
StableUpgraded with the latest SnapLogic Platform release.
4.8 Patch rabbitmq2731 Latest
  • Provided the Enhance Exchange Header support for RabbitMQ Snap Pack.
  • x-match and Header properties added to support different exchange headers. 
4.8 Patch rabbitmq2720 Latest
  • Addressed the following issues:
    • RabbitMQ Snap Pack - Thrown by RESTEasy when HTTP Not Acceptable (406) is encountered.
    • Unable to configure RabbitMQ - Producer to work with existing Topic Exchange
    • Exchange type and Durable Exchange added to support different exchange types. 
4.8

snapsmrc398

 
Stable

Info tab added to accounts.

4.7

snapsmrc382

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

snapsmrc344

 
Stable

Resolved an issue with the Producer and Consumer Snaps not releasing connections.

4.4.1
 Stable

NEW! This Snap Pack contains a Consumer and a Producer Snap.