About RabbitMQ Message Services

Last Updated: 10/18/2018 Introduced in Version:

OVERVIEW

Rabbit Message Queue

RabbitMQ is a .Net messaging system for application to application communication. The RabbitMQ module adds RabbitMQ capability into the Decisions messaging service and lets you connect Flows that you have built in Decisions to RabbitMQ queues as subscribers so that the Flows can work messages. User can also push messages to queues using a simple Flow step. 

The purpose of integrating Decisions with RabbitMQ is to deserialize the format and process the message data into whatever type the user may needs. RabbitMQ Message Services acts as a mediator, the service takes in a message from other systems to process. Decisions integrates with RabbitMQ and can take in a message and then convert the message to any type of data for processing. In order to integrate Decisions with RabbitMQ, the module will need to be installed in Decisions.

 

Install

 For RabbitMQ you will need to install the RabbitMQ module from the module page. Navigate to the Designer Folders under System>Administration>Features and select the desired module. 

For more information on installing modules see attached link: https://documentation.decisions.com/setting-messaging-overview/

 

Subscribing to a Queue

Systems>Jobs and Events and right click Message Queue Handlers 

Settings:

Is Durable Queue: When Decisions creates the queue the durable queue keeps the message permanently.  For example, if no one is using the queue this setting when selected 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 specific server to be set up. 

Override Virtual Host: Allows you 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. 

Override Queue Credentials: Provides the ability to set up username and password that can be assigned allowing specific credentials to be required. 

After entering the Display Name, Queue Name and Custom Connection String, the Azure Message Queue is now save in the designer view. 

Right click on the message queue and select from the listed settings. This list of selections gives you the ability to delete, edit, add, control, import/export and manage your queue. 

Select Control and a different Queue options are displayed. 

Resync Queues: Recreates the message queues if necessary and re-synchronizes with the message server.

Start Queues: Starts processing messages on the message queues (if stopped).

Stop Queues: Stops processing messages on the message queues.  The message server will hold any unprocessed messages.

Test Queues: Reads the number of waiting messages on the queue and shows a pop up with the amount of waiting messages.  An easy way to verify connectivity to a queue.

 

Add Message Handler

When a Message Handler Flow is created, it will have “Message Queue Handler Flow” behavior. This gives it two special Inputs: a Handler Id identifying the Message Queue Handler that received the message, and Message, which contains information about the message that Decisions received from the message server. In the Message is the Payload field, which contains the raw data for the message contents.

 

  1. Handler Name –The name of this handler to display in Decisions. 
  2. Message Handling – do you lease the message (lock), lease the message temporarily (lock with auto timeout), remove it after processing (pop), or use it but leave it on queue (peek).
  3. Active Flow Count – Maximum number of simultaneous messages that Decisions will process. 
  4. Handler Flow –The flow used to process messages that appear in the queue. This is the flow we created above.
  5. Message Queue – The queue for the handler to listen on, that was configured in system settings.

Get: Reads messages from the Message Server and tells the Message Server that they’ve 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.

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 time out and the Message Server will mark it as deliverable to another client.

Note: Lease Mode is is slightly slower than “Get” modes, 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.

 

 

Message Handler Flow:

When a Message Handler Flow is created, it will have “Message Queue Handler Flow” behavior. This gives it two special Inputs: a Handler Id identifying the Message Queue Handler that received the message, and Message, which contains information about the message that Decisions received from the message server. In the Message is the Payload field, which contains the raw data for the message contents.

 

Building a Message Handler Flow will require different steps depending on the contents of the message that is being formatted. Each format whether it be a simple text, XML or JSON have different steps that extract the contents of the message. After choosing the correct step for the message, build the flow to react to the contents.

 

For information on how to build a message handler flow please see attached link: https://documentation.decisions.com/setting-messaging-overview/.

Additional Resources