To ensure the system maintains high efficiency and is capable of handling the intensive data stream load, it is crucial to optimize the event processing capabilities. This is particularly important as Mediaserver tends to generate a substantial volume of events at the start and conclusion of operations. A system that is not optimized for such a load may experience a decline in service quality or a complete stop.
Webhooks enable an external service to be notified about events within Mediaserver operations or changes in the state of streams. These notifications are dispatched as packages, with each request containing up to 50 events. There is a limit of 5000 events in the queue for dispatching. If the limit is exceeded, the oldest events will be ignored. The event format application/json is typically as follows:
JSON
{
"event": "An event type, see below",
"device": "mediaserver",
"server": "host name of a mediaserver",
"pid": 1234,
"timestamp": 12345,
"seq": 1,
"data": "Contains additional information about an event"
}
The section to configure Webhook in server.json
dsncluster.webhook = "http://localhost:8080/event/" – a server URL that will receive events. The webhook functionality won’t be available without defining a URL or when it’s wrong.
arraycluster.events – an array of event identifiers that can be sent. If not specified or empty, all events are sent.
The details on the event types are below in the table.
service:down – signifies that the service has received a shutdown signal and is in the process of attempting to cease operations properly, although this event may not always be issued.