Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/akayibrahim/featureflags

FeatureFlags for Spring Boot - Project 7
https://github.com/akayibrahim/featureflags

annotation easyfeaturetoggle featureflags java spring spring-boot springannotation springannotations springboot

Last synced: about 1 month ago
JSON representation

FeatureFlags for Spring Boot - Project 7

Awesome Lists containing this project

README

        

# Feature Flags Annotation for Spring (Java)

#### This project is for toggle off/on of java features.

**Follow steps:**

1 . Add below dependency to pom.xml of your project
```java

io.github.akayibrahim
featureflags
1.0.4

```
2 . Add below import annotation to your spring boot main class.
`@Import(FeatureFlags.class)`

Example usage:
```java
@SpringBootApplication
@Import(FeatureFlags.class)
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
```
3 . Now you are ready. You can add FeatureFlags annotation to your methods like below.
```java
@FeatureFlag(enabled = "featureFlags.demo")
@Override
public void demo() {
System.out.println("Demo Feature Flags");
}
```
4 . Don't forget add toggle parameter to your config file. (application.properties / application.yml)
```yaml
featureFlags:
demo: true
```

NOTES:
- if your method has return object, don't forget null check when the method call.
- Feature Flags can not use for Aspect.