Supervision¶
The supervision service monitors the state of recipients logged into the backend.
Configuration¶
Supervision is disabled by default
To enable it, set the enabled
option in the supervision
section of broker’s the configuration file.
Options:
enabled: | Whether to enable supervision, defaults to false |
---|---|
node.polling.interval: | |
How often recipients should be checked, the value is the time interval in seconds | |
node.polling.timeout: | |
The timeout for checking recipients, the value is the duration in seconds | |
node.misses.threshold: | |
The number of consecutive polling timeouts to wait before the recipient can be considered lost, the value is the number of timeouts to allow |
Example configuration:
[supervision]
; supervision is disabled by default for backwards compatibility
enabled = true
; polling time interval in seconds, determines how often event nodes are checked
node.polling.interval = 5
; time between pings
node.polling.timeout = 1
; number of timed out pings to allow before considering the recipient as lost
node.misses.threshold = 2
backsocket = inproc://#back2sup
Polling¶
Supervision works by checking recipient regularly to make sure that they are still available. The supervisor issues an RPC call to each recipient using the Xbus recipient API.
If the RPC call fails, the recipient is considered to have ‘missed’ the call.
After a number of misses (see node.misses.threshold
above) the recipient is considered as lost.
When a recipient is deemed lost, the broker terminates that recipient’s session (logout). The broker backend keeps a list of inactive recipients.