Connection Monitoring API
2024 Feb 13
Concept of Connection Monitoring API in NSM
Table of contents
Connection Monitoring API
Description
Connection Monitoring API allows users to monitor NSM connections. This functionality can be used to build some third-party applications. An example of such application is NSM Dashboard.
Concept
- All NSM components except Network Service Client provide a Monitor Connection Server.
- Users can connect to these servers using a Monitor Connection Client and monitor connections owned by different NSM components.
- The components can send Connection Events to all subscribed Monitor Connection Clients if any connection is created, changed or deleted.
Each NSM component montors connections of the next component in the chain. If the next component generates a Connection Event, the current component receives this event and sends it back to the previous component in the chain.
Types of events
INITIAL_STATE_TRANSFER: MonitorConnection Server sends an event with this type to MonitorConnection Client when the client makes the first request. The event with this type contains all connections owned by the MonitorConnection Server.
UPDATE: Monitor Connection Server sends an event with this type when a connection changes. For example, the state of the connection has been changed.
DELETE: Monitor Connection Server sends event with this type when the connection has been closed.
Example of UPDATE event
On the Diagram 1 you can see when NSM sends UPDATE event. It has the following steps:
- NSM components monitor each other
- Forwader changes a connection context of one of connections
- Forwarder sends UPDATE event with the changed connection to NSMgr
- NSMgr sends UPDATE event with the changed connection to NSC
Diagram 1: an example of UPDATE event in NSM
Example of INITIAL_STATE_TRANSFER, UPDATE and DELETE event
Diagram 2 shows when NSM sends INITIAL_STATE_TRANSFER, UPDATE and DELETE events. Steps:
- 3rd-party app start to monitor connections of NSMgr
- NSMgr sends INITIAL_STATE_TRANSFER event with all its connections
- NSC connects to NSE
- NSMgr sends UPDATE event with the new connection established between NSC and NSE
- NSC closes the connection
- NSMgr sends DELETE event with the closed connection
Diagram 2: an example of INITIAL_STATE_TRANSFER, UPDATE and DELETE event in NSM
References
Table of contents