For asynchronous listening/notification of the Avid Platform events, channel messages must be used.
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.
In general, channel message has the following fields:
|Field Name||Type||Description||Is Required||Default|
|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:
Channel message context have special object "sender", which is populated automatically by Secure Gateway.