Spring with typical toggles + bean toggles #7420
Unanswered
SamuelProgresista
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi Samuel, With unleash's Spring-Boot starter SDK you can inject the Unleash instance and use the import io.getunleash.Unleash;
public class SomeClass {
private final Unleash unleash;
public SomeClass(Unleash unleash) {
this.unleash = unleash;
}
void someMethod() {
boolean enabled = this.unleash.isEnabled("flagName");
}
} If this is not what you need, please specify your question :) Malte |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good morning!
My team and I have been working on a system for over 5 years, where we started to use feature toggles. This system runs on Java 11 and Dropwizard. We used the Unleash library (unleash-client-java) and employed the "isEnabled" methods in the code.
The problem we encountered was when we needed to change a service or data structure. We didn’t know how to handle it, so in these cases, we didn't implement any toggles.
Now, we are migrating to Spring, and I’ve seen this new library for Spring about Unleash. It is very interesting because if you change the implementation of a service, it provides a defined way to do it.
However, I have a question. Sometimes you need to use the "isEnabled" method to change a small piece of code because we have 10 people working on the project. But I don't see any example in the Spring project on how to handle this situation. I see how to use bean A or B depending on the toggle status, but how should you manage it if you have to change a small piece of code, considering that another person might have another ticket to change a different part of the code in the same service?
Regards,
Samuel
Beta Was this translation helpful? Give feedback.
All reactions