Skip to content

mageddo-projects/toggle-first

Repository files navigation

Using With Spring

Register feature manager for database persistence

@Bean
public FeatureManager featureManager(DataSource dataSource){
	return new DefaultFeatureManager()
		.featureMetadataProvider(new EnumFeatureMetadataProvider())
		.featureRepository(new JDBCFeatureRepository(dataSource))
	;
}

Create your Feature enum

public enum Parameter implements InteractiveFeature {

	@FeatureDefaults(status = Status.ACTIVE, value = "Congrats!")
	FREE_COINS

	;

	@Override
	public FeatureManager manager() {
		return FeatureContext.getFeatureManager();
	}
}

Using

Parameter.FREE_COINS.isActive();

Registering JMX

FeatureSwitchJMX.register();

Examples

About

Feature Toggle for your projects, whatever language you use

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published