RabbitMQ

RabbitMQ is an open source message broker which follows the AMQP 0-9-1 (Advanced Message Queuing Protocol) standard.

BaziCloud uses it to send message to start, reconfigure and stop processes.

Architecture Notes

There are 4 types of exchange supported by AMQP0-9-1 - in general we ignore the 2 simplest types: Direct (everything declared up front, 1-to-1 mapping) and Fanout (every mesg copied to all output queues). Of the other two: Headers and Topic, it seems to me that topic is easier to understand , but has the features we need. We could use Headers, but some of the filters become a bit obscure.

Topics Exchange

Each message is sent with a topic specified as list.of.dot.separated.names. Recipients can subscribe to messages based on topic filter built with names adn wilcards. * matches any one name; # macthes any number of words. If we define a naming heirarchy then selecting certain types of message will be easy.

Version 1 Naming Structure

Messages are sent to a topic exchange, which are then routed to client queues filtered by the topic provided in the routing_key of the queue_bind call. I propose 4 exchanges, each for a different purpose:

  • Commands
  • Status
  • Measurements
  • Messages

The topic shall contain the following parts (NB some parts are )

  1. Domain - HW, Process, Task (not needed for Messages)
  2. Command, Status, Measurment or Message Type
    • Command HW - Wake, Suspend, Reboot, Upgrade
    • Command Process - Wake, Suspend, Reboot, Add, Delete
    • Command Task - Start, Cancel
    • Status - Running, Rebooting, Restarting, Restart-Success, Crashed, Timedout
    • Measurements - ?? (possibly not required - leave in and ignore for now)
    • Messages - Standard, Active Users Only, Expiring
  3. Customer 3 or 4 letter name - BAZI for BaziCloud, SYS for System
  4. Target: HW=Computer-Name, Process=Name, Task=Name, Message=Destination

The domain will be prefixed by TEST for test messages.

Best explained with examples for each queue:

Commands

  • HW.Wake.SYS.PI1
  • Process.Add.BAZI.ChatBot

Status

  • HW.Restart-Success.SYS.PI2
  • Task.Crashed.FMLY.Backup

Measurements

  • Process.Load.SYS.Metal1
  • Task.Completed.BAZI.Invoice-Sync

Messages

  • ActiveOnly.FMLY.ALL
  • Expiring.BAZI.ADMINS

Old Notes

  • HW - Wake/ Suspend/ Upgrade/ Reboot/ Add/ Delete
  • Process - Wake/ Suspend/ Upgrade/ Reboot/ Add/ Delete
  • Task - Enable/ Disable/ Start/ Kill
  • Message - Types are broadcast/ alert/ notice. Dests are company wide/ group-wide or individual

Message groups for each customer/ app user, so a process error could trigger a message to a group.