-
Hey everybody, I'm starting to work with Gitlab's feature flags and the unleash java client. I found the option to bootstrap feature from an outside source like S3, but I don't see an option change the local backup. I would like the unleash client to store its backup file in the same S3 bucket, i.e. use the same file as for bootstrapping. My concern is that on a multi instance scenario, all instances might initialise with the same features, but since each one might loose connection to Gitlab at any point, I would like to have a centralised backup file so every instance has the same feature state. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @lakedude. You can do this yourself by implementing the ToggleBootstrapProvider. See https://github.com/unleash/unleash-client-java?tab=readme-ov-file#bootstrapping |
Beta Was this translation helpful? Give feedback.
I see I need to upgrade my reading skills. Because you're asking for the write side of the backup to also be customizable. You'd need to look into a custom instance of FeatureRepository, which accepts a BackupHandler (which exposes both write and read).
We don't want to have s3 as a dependency in the unleash sdk.
So work needed would be
FeatureRepository fr = new FeatureRepository(unleashConfig, s3BackupHandler);
new DefaultUnleash(UnleashConfig, fr, ...anyCustomStrategies)