Description
We want to implement a granular approach to control cps notifications. it will help in performance improvement by suppressing the unwanted messages in Kafka message stream
Proposal
We propose to implement an admin API to control (Enable/Disable) the Kafka notifications at Anchor level. This API provides below functionalities
- Using this API notification can be subscribed/unsubscribed for an Anchor.
- All the Anchors for a given Dataspace can be enabled/disabled for the notification.
Implementation
API
URL : PUT http://<IP:PORT>/cps/v2/dataspaces/{dataspaceName}/{subscription}
Query Parameters:
Parameter | Description |
---|---|
dataspaceName | Dataaspace name |
subscription | subscribe or unsubscribe |
["anhcor01", "anchor02", "anchor03" ...]
Note: To enable all the anchors of the given dataspace, we can use empty request payload
Persistence
Information about the subscription of notification will be persisted in Fragment table. For Example if the notification is subscribed by anchor_id 28, fragment table will have below entry