Skip to content

ari 3.0 NATS Events

Sheena Artrip edited this page Sep 26, 2016 · 1 revision

ARI v3 events are now being forwarded through the ari / NATS gateway to the ari v3 NATS client. Events are sent on the topic ari.events.eventType and the body is the raw message body sent from WebSockets.

For Subscriptions using handles, we are simply getting all events of a given type and checking if it matches some criteria. For the native client, this is mostly required.

For the nats client, this may or may not be required (We could send on ari.events.general.eventType and ari.events.channel.eventType.channelID... this requires encoding each event struct or event type with instructions on how to convert it to an appropriate series of NATS subjects. It means we can make smarter subscriptions: ari.events.channel.*.ID for all channel events for the given channel ID.

Code

Channel specific subscription:

https://github.com/CyCoreSystems/ari/blob/v3/client/nc/channel.go#L149

Event forwarding code:

https://github.com/CyCoreSystems/ari/blob/v3/server/natsgw/events.go#L12

Clone this wiki locally