HomeDevCentral

Broker and notifications system

Description

Broker and notifications system

Summary:
Any application having something interesting to broadcast can publish
a notification to our broker, directly or through the notificaitons center.

We have an AMQP client to connect to the broker.

Every second, Wearg reads the notifications queue and will broadcast
notifications.

Bot setup

First, this requires a TCL extension to inteact with an AMQP client
(see dereckson/rabbitmq-tcl).

To use this:

source Wearg/Broker.tcl
source Wearg/Notifications.tcl
notifications::init
broker::init

Note: don't forget the notifications::init: if you don't bind the notifications
before starting to get messages, they will be lost.

To recover after an issue, broker::on_tick should be enough to restart the timer
(check utimers to know if you've lost one on an error)

Extend the code

To get a notification: notifications::bind <service> <projec> <group> <type> <callback procedure>.

The callback procedure will get service project group rawContent type text link as arguments.

To get a broker message: broker::bind <queue> <callback procedure>

The callback procedure wil lget queue message as arguments.

Test Plan: live test with a notification of each kind from GitHub

Reviewers: dereckson

Differential Revision: http://devcentral.nasqueron.org/D106

Details

Provenance
derecksonAuthored on
Differential Revision
D106: Broker and notifications system
Parents
rVIPERSERVf951ee400e0c: do while
Branches
Unknown
Tags
Unknown