FeatureAccessorCore is a Java library designed to provide a flexible and extensible way to manage feature flags and configuration properties in your applications. It supports multiple providers, including property files and in-memory flags, and is built to integrate seamlessly with modern Java projects.
- Feature Flag Management: Provides a way to enable or disable features at runtime.
- Providers: Supports different sources for feature flags, such as:
- Properties File Provider (
PropertiesFileFlagProvider): Reads flags from a properties file. - In-Memory Provider (
InMemoryFlagProvider): Stores flags in memory for testing or dynamic use. - Lambda/Custom Provider (
LambdaFlagProvider): Allows custom logic for flag evaluation with lambda. - Support for combining multiple providers (
MultiFeatureProvider): Enables chaining or prioritizing several providers to resolve feature flags from different sources.
- Properties File Provider (
- Integration with OpenFeature: Compatible with the OpenFeature SDK for interoperability.
- Java 21 or higher
- Maven 3.6+
Add the following dependency to your pom.xml:
<dependency>
<groupId>com.laulem</groupId>
<artifactId>feature-accessor-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>- Configure your feature flags in a properties file (e.g.,
feature-accessor.properties). - Initialize the provider in your Java code:
# feature-accessor.properties
feature-accessor.feature_XXX=true// Example usage
OpenFeatureAPI.getInstance().setProvider(new PropertiesFileFlagProvider("feature-accessor.properties"));
boolean isEnabled = OpenFeatureAPI.getInstance().getClient().getBooleanValue("feature_XXX", false);- Switch providers or extend with your own by implementing the provider interface.
src/main/java/com/laulem/featureaccessorcore- Core library source codesrc/test/java/com/laulem/featureaccessorcore- Unit tests
Contributions are welcome! Please open issues or submit pull requests via GitHub.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
For questions or support, please open an issue on GitHub or contact the maintainers.
LEMAIRE Alexandre
- Website: https://www.laulem.com
- Mail: alexandre.lemaire@laulem.com