79690138

Date: 2025-07-04 11:54:31
Score: 0.5
Natty:
Report link

In your implementations, add the bean name.

public class OldFeatureService implements FeatureService{
    @Service("oldFeatureService")
    public String testMe() {
        return "Hello from OldFeatureService";
    }
}
public class NewFeatureService implements FeatureService{
    @Service("newFeatureService")
    public String testMe() {
        return "Hello from NewFeatureService";
    }
}

By default, springboot uses the bean with @Qualifier("OldFeatureService"). When the flag is enabled, it looks for the alterbean=newFeatureService

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Nimesh