Channel Message

For asynchronous listening/notification of the Avid Platform events, channel messages must be used.

Overview

Avid Platform provides API for events listening and notifications over AMQP. In a very high level, two parties are involved in this. One, which is responsible for posting notifications, another, which is interested in listening for these notifications. Avid Platform API leverage RabbitMQ message routing features, which makes easier to filter out messages, by specific pattern. In terms of Avid Platform API such messages called channel messages.

Avid Platform channels and channel message themselves have two major identifiers:

  • channel name;
  • channel subject;

Both channel name and channel subject must be provided as dot separated words, in low case, i.e. 'bus.updates', 'registry.remote.update'. Using this naming convention, consumer of these notification may register to listen for subset of the messages by using wildcards: * (star) and # (hash).

  • * (star) - can substitute for exactly one word;
  • # (hash) - can substitute for zero or more words;

In high level, posting and consuming channel messages functionality can be represented by the following diagram.

Avid Platform API provides two types of subscribing for channel messages:

  • individual subscriber -  in this case all individual consumers will receive each channel message;
  • shared subscriber - in this case shared name must be provided and only one shared consumer receives next incoming message. Messages will be distributed in round-robin way between shared consumers.

Channel Message

In general, channel message has the following fields:

Field Name Type Description Is Required Default
channel string channel name true n/a
subject string subject of the message true n/a
context object additional context parameters to be passed in the channel message false n/a
dataSet object channel message data false n/a

Example of the channel message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
"channel": "service.notification",
"subject": "data.update",
"context": {
"sender": {
"access": {
"id": "8dbb4278-1204-4686-92cd-e373cba728d3",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"proxyBal": "node.js 3.7.2",
"gateway": {
"id": "7b8eb0e5-738a-40f5-8515-6b5bf308db9d",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"environmentId": "black"
},
"service": {
"id": "94662691-c1fa-4a5b-9a20-919cb0d5e427",
"bal": "node.js 3.7.2",
"host": "acs-zone-black",
"pid": 5549,
"platformId": "black",
"buildNumber": "3.5.3_2_g70b0518-1.x86_64",
"environmentId": "black"
}
}
},
"customData": {
}
},
"dataSet": {
"messageData": {}
}
}

Channel message context have special object "sender", which is populated automatically by Secure Gateway.