- 09 Dec 2021
- 4 Minutes to read
- Print
- DarkLight
About RabbitMQ Message Services
- Updated on 09 Dec 2021
- 4 Minutes to read
- Print
- DarkLight
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.
- Active RabbitMQ application.
- RabbitMQ Module installed. For more information on how to install modules, see Installing Modules in Decisions.
Example
This example will demonstrate how to configure RabbitMQ in Decisions.
- Navigate to System > Jobs and Events. Right-click Message Queues and select Add Rabbit Queue.
- 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 Options Description DEFINITION Display Name Determines how the Queue's name displays. Queue Name The name of the Queue that the system references. Is Durable Queue When 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 Delete Instructs the Message Server to delete the Queue when its last consumer disconnects. Override Server Info Allows the specific server to be set up. This includes the Server IP or Name as well as the Port number. Override Virtual Host Allows 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 Name Specify the IP address or server name Use Default Port Allows user to enable using the default port Use SSL Enables use of SSL Override Queue Credentials Provides the ability to set up a username and password that can be assigned allowing specific credentials to be required QUEUE ARGUMENTS Dead Letter Exchange Queue for undelivered or failed messages Dead Letter Routing Key Routing key for dead letter Maximum Queue Length Sets the maximum queue length Message TTL (msec) Sets the message time-to-live in milliseconds - 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 Options Description Disable Queue Disables the queue Resync Queue Recreates the Message Queues if necessary and re-synchronizes with the Message Server Start Queue Starts processing Messages on the Message Queues (if stopped) Stop Queue Stops processing Messages on the Message Queues. The Message Server will hold any unprocessed messages. Test Queue Reads the number of awaiting Messages on the Queue and shows a pop-up with the amount of awaiting Messages - Click DISMISS on the dialog popup screen that will appear displaying the result of the test.
- Navigate to System > Jobs and Events > Message Queue Handlers. Click ADD MESSAGE HANDLER.
Configuration Options Description Handler Name Name to display in Decisions Message Handling Sets 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) Lease Reads 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 Get Reads 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 Count Maximum number of simultaneous Messages that Decisions will process Handler Flow The Flow used to process Messages that appear in the Queue Message Queue The 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. - 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.