Flows
Startup Flow
What happens when a Spring Boot app using this starter starts up:
- Auto-config registration. Each module lists its
@AutoConfigurationclasses inMETA-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. The core module registersAspectAutoConfiguration+HealthAutoConfiguration; the autoconfigure module registersClientAutoConfiguration,OpenFeatureAPIAutoConfiguration, andSecurityAutoConfiguration. - Provider bean. A provider starter (e.g.
UnleashAutoConfiguration) readsspring.openfeature.<provider>.*properties, applies any consumer-supplied provider customizer, and exposes adev.openfeature.sdk.FeatureProviderbean. It is annotated@AutoConfigureBefore(ClientAutoConfiguration.class)so this happens first. - API singleton.
OpenFeatureAPIAutoConfigurationexposesOpenFeatureAPI.getInstance()and installs a default customizer that logs providerREADY/ERROR/STALE/configuration-change events. - Security hook. If
SecurityContextHolderis on the classpath,SecurityAutoConfigurationadds a hook injectinguserIdandauthoritiesfrom the current authentication — see features/security-integration. - Client bean.
ClientAutoConfiguration(guarded by@ConditionalOnBean(FeatureProvider.class)and@ConditionalOnMissingBean(name = "multiProvider")) callssetProviderAndWait(provider)— blocking until the provider is ready — then exposes theClientbean after running allClientCustomizers.
In multi-provider mode the flow diverges at step 5: MultiProviderAutoConfiguration wins and builds the client from all FeatureProvider beans — see features/multi-provider.
Downstream, flags are evaluated via the Client bean or via @ToggleOnFlag — see flows/flag-evaluation.