About RabbitMQ Message Services
  • 09 Dec 2021
  • 4 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

About RabbitMQ Message Services

  • Dark
    Light

Article summary

Overview

Message Queue architecture allows a designed system to handle large amounts of client requests by placing them into a queue to then process asynchronously. Message Queues can be placed between an application server and a database server. This setup lets the application server send a response to the requesting user and then place the request in the Message Queue. The database server can then pick up the request from the Message Queue and process that transaction.

Rabbit Message Queue (RabbitMQ) is a messaging system for application-to-application communication. The RabbitMQ module adds capability into the Decisions messaging service which lets users connect Flows built-in Decisions. RabbitMQ queues subscribers so that the Flows can work Messages. Users can also push messages to Queues using a simple Flow step. Decisions can integrate with RabbitMQ and takes in a Message and then convert the Message to any type of data for processing.

Prerequisites
The following is required before proceeding with proper RabbitMQ integration:


Example

This example will demonstrate how to configure RabbitMQ in Decisions.

  1. Navigate to System > Jobs and Events. Right-click Message Queues and select Add Rabbit Queue. 
  2.  On the Add Rabbit Queue dialog window, enter a Display Name and the Queue Name. Then, configure any other options necessary and click OK.
    Configuration OptionsDescription
    DEFINITION

    Display NameDetermines how the Queue's name displays.

    Queue NameThe name of the Queue that the system references.

    Is Durable QueueWhen Decisions create the Queue, this setting keeps the Message permanently. If no one is using the Queue, this setting will reclaim the Message Queue and recreate the Message.

    Auto DeleteInstructs the Message Server to delete the Queue when its last consumer disconnects.

    Override Server InfoAllows the specific server to be set up. This includes the Server IP or Name as well as the Port number.

    Override Virtual HostAllows the ability to set up multiple virtual hosts allowing the user to host Decisions. The Virtual host runs in order to keep the actual production from interference.

    Server IP or NameSpecify the IP address or server name

    Use Default PortAllows user to enable using the default port

    Use SSLEnables use of SSL

    Override Queue CredentialsProvides the ability to set up a username and password that can be assigned allowing specific credentials to be required
    QUEUE ARGUMENTS

    Dead Letter ExchangeQueue for undelivered or failed messages

    Dead Letter Routing KeyRouting key for dead letter

    Maximum Queue LengthSets the maximum queue length

    Message TTL (msec)Sets the message time-to-live in milliseconds


  3. Navigate to System > Jobs and Events > Message Queues. Right-click on the Message Queue and select Control. Select Test Queue to verify the connection with RabbitMQ.
    Configuration OptionsDescription
    Disable QueueDisables the queue
    Resync QueueRecreates the Message Queues if necessary and re-synchronizes with the Message Server
    Start QueueStarts processing Messages on the Message Queues (if stopped)
    Stop QueueStops processing Messages on the Message Queues. The Message Server will hold any unprocessed messages.
    Test QueueReads the number of awaiting Messages on the Queue and shows a pop-up with the amount of awaiting Messages


  4. Click DISMISS on the dialog popup screen that will appear displaying the result of the test.
  5. Navigate to System > Jobs and Events > Message Queue Handlers. Click ADD MESSAGE HANDLER.
    Configuration OptionsDescription
    Handler NameName to display in Decisions
    Message HandlingSets the Message Handling mode to lease the message (lock), lease the message temporarily (lock with auto timeout), remove it after processing (pop), or use it but leave it on the Queue (peek)

    LeaseReads Messages from the Message Server and tells the Message Server that they are being processed, this is used when every Message must be handled. The Message Server keeps them in the Queue, marking them as "leased" by a client (that is, Decisions), and does not deliver them to any other client that requests Messages from the Queue. When Decisions finishes handling the Message by running the Handler Flow, it tells the Message Server that the Message has been handled and the Message Server marks it for deletion. If Decisions doesn't do this (for example, if the Handler Flow encountered an error), then the lease on that Message will eventually timeout and the Message Server will mark it as deliverable to another client. Lease mode is slightly slower than Get mode but doesn't have the problem where Messages can be lost in memory prior to being processed if the Decisions server shuts down or gets rebooted.

    Lease w/ Expire

    GetReads Messages from the Message Server and tells the Message Server that they have been handled. The Message Server removes them from its Message Queue. This mode instructs the relevant Message Server or third party client to pull Messages off of the Message Server as fast as possible and keep them in an in-memory list for Decisions to pull from

    Get and Remove
    Active Flow CountMaximum number of simultaneous Messages that Decisions will process
    Handler FlowThe Flow used to process Messages that appear in the Queue
    Message QueueThe Queue for the Handler to listen on, that was configured in System Settings



    If setting the Message Handler mode to Get or Get and Remove mode, Decisions will auto-ACK every message. If using Lease or Lease w/Expire mode, Decisions will only ACK if the handler's Flow completes successfully. If the Flow happens to throw an exception, Decisions will send a negative ACK.


  6. Click Pick to pick a Handler Flow or Create to create a Message Queue Handler Flow. Then, click OK to close the dialog window. 
    To learn more about creating a Message Handler Flow, click Setting Up Messaging Overview






Was this article helpful?