gravitee-api-management
gravitee-api-management copied to clipboard
Add an HeartbeatStandalone strategy
Issue
https://github.com/gravitee-io/issues/issues/8482
Description
Refactor HeartbeatService to split implementation into two strategies.
Current implementation is moved to HazelcastHeartbeatStrategy
Create a dedicated standalone implementation: StandaloneHeartbeatStrategy
It is responsible of creating or updating the heartbeat event at fixed interval.
Once the event has been created, it has been decided to call the createOrUpdate
method with a lite version of the event, containing only the requested field for the update (id,
updatedAt
, properties.last_heartbeat_at
)
Why ?
Heartbeat event is a big object (it contains the list of plugins, and a big list of properties).
Sending only the required fields for update allow to:
- save bandwidth between gateway client and gateway server
- save bandwidth between gateway server and dbms
- by default, event are sent every 5 seconds, for x gateways running, it can be a lot of event to handle at nearly the same time for the dbms, reducing the size reduce the pain.
- query are now optimized for update
🚀 CI was able to deploy the build of this PR, so you can now try it directly here Notes: The deployed app is linked to the management API of APIM master. (Same login and password as APIM master)
📚 View the storybook of this branch here