Feature Flags for OSGi Service Platform
APACHE-2.0 License
This is an implementation of the Feature Toggles pattern (also known as Feature Flags) for OSGi Service Platform. Feature Flags (also known as Feature Toggles and Feature Controls) is the software development practice that facilitates the easy enablement and disablement of deployed functionalities. Besides, feature flags ease the management of the feature's entire lifecycle. These allow you to manage components and compartmentalise risk. We can also roll out the features to a specific group of users or exclude the group from accessing it, perform A/B test and much more. Its also the way to test how your features function in the real world and not just in an artificial test environment. Therefore, feature toggle is a widespread agile development practice in the context of continuous deployment and delivery.
This project comprises three bundles -
com.amitinside.featureflags.api
- The core feature flags APIcom.amitinside.featureflags.provider
- The core feature flags implementationcom.amitinside.featureflags.example
- Example project showing how to use core feature flags in codebaseAs test dependencies, the following test libraries are used:
To use feature flags in OSGi environment, you only need to install com.amitinside.featureflags.provider
.
Want to contribute? Great! Check out Contribution Guide
Import as Eclipse Projects
File -> Import -> General -> Existing Projects into Workspace
)./gradlew clean build
in the project root directoryThis project is licensed under Apache License
@ObjectClassDefinition
@interface MyConfig {
@AttributeDefinition(name = "My First Feature", description = "My Feature Description")
boolean osgi_feature_myfeature() default true;
}
or provide a metatype XML with the required configuration in your bundle's OSGI-INF/metatype
directory
<?xml version="1.0" encoding="UTF-8"?>
<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.2.0" localization="en_us">
<OCD id="ExampleFeatureFlagOCD"
name="My Feature Configuration">
<AD id="osgi.feature.myfeature"
name="My First Feature"
description="My Feature Description"
type="Boolean"
cardinality="0"
required="true"
default="true">
</AD>
</OCD>
<Designate pid="ExampleFeatureFlagOSGiR4WithXML">
<Object ocdref="ExampleFeatureFlagOCD"/>
</Designate>
</MetaData>
For more information, have a look at the example project.