[Feature] API Consumer Notifications
Problem
Problem
- APIM currently offers a notification mechanism that operates through the database.
- APIM users might want to use different notification modes (ex: email, sms etc) and to support such requirements current design would require extensive modifications.
Solution
- Implement an extensible notification system following a pub-sub architecture.
- Continuation of https://github.com/wso2/api-manager/issues/2383
Affected Component
APIM
Version
4.4.0
Implementation
No response
Related Issues
No response
Suggested Labels
No response
Consumer Notifications Scenarios Document - https://docs.google.com/document/d/1Hn6eb25000SZWEOsnDTsVf6e9aKFsmvKAwC2ljRLRtE/edit?usp=sharing
AsyncAPI Definition Document - https://docs.google.com/document/d/1OHNWqiLt8w_oEfbvzxImMukCBEcOFYT_Ots0JHPAxvo/edit?usp=sharing
Design Document - https://docs.google.com/document/d/1hVELgd-hkIIXBzIT6CGx58r4Jy0pBJ8Bz7Pzuiihvp0/edit?usp=sharing
Can use the following as the WebSub Hub when testing the feature.
https://central.ballerina.io/ballerina/websubhub/1.11.0 https://github.com/ballerina-platform/module-ballerina-websubhub/tree/main/examples
Sub Tasks -
- [x] Finalize the design - https://docs.google.com/document/d/1hVELgd-hkIIXBzIT6CGx58r4Jy0pBJ8Bz7Pzuiihvp0/edit?usp=sharing
- [x] Finalize the list of operations to be used - https://docs.google.com/document/d/1Hn6eb25000SZWEOsnDTsVf6e9aKFsmvKAwC2ljRLRtE/edit?usp=sharing
- [x] Do the async API definition - https://docs.google.com/document/d/1OHNWqiLt8w_oEfbvzxImMukCBEcOFYT_Ots0JHPAxvo/edit?usp=sharing
- [x] Check and refactor the implementations for Notifications Pages (with the bell icon) in Publisher and DevPortal, Notifications retrieval from the DB, Rest API changes
- [x] Do the UX design of the topic subscription page in the Admin portal - https://excalidraw.com/#json=cGXEqu0FxOIn8L53LnwWY,WeQcq4IYdi1Htn-yXiIaWg
- [ ] Do the implementation for the topic subscription UI
- [ ] Do the implementation for the topic subscription backend part - To send topic subscriptions to the Hub when a user subscribes to a topic via the UI
- [ ] Do the implementation for the event publishing from the UI portals
- [ ] Do the Ballerina WebSub Hub implementation to support topic subscriptions and send event notifications to the DB WebSub Server
- [ ] Do the implementation for the DB WebSub Server to save the events to the DB
- [ ] Do the implementation for the notifications retrieval - Should retrieve the notifications based on the logged in user + the notifications based on the subscribed topics
- [ ] Complete the implementation to cover the full flow (Users subscribe to topics, Ballerina Hub publishes event notifications to DB websub server when an event for APIs/applications/API products related operations occurs, WebSub server saves notifications to DB, User sends a Http request via the notifications page to DB websub server to retreive the event notifications from the DB, WebSub server sends notifications to notifications page, Users view the notifications + read/unread/delete them)
- [ ] Test the implementation for the default DB websub server
- [ ] Test the implementation with the Ballerina websub Hub
- [ ] Do the documentation
- [ ] Write tests
Draft PR - REST APIs required for the feature