How to use ConditionalOnProperty on method level

88 Views Asked by At

To enable feature flag on controller level I will use for example ConditionalOnProperty annotation to give me options to control it via properties sth like this.

@RestController
@ConditionalOnProperty(name = "featureFlag", havingValue = "true", matchIfMissing = false)
public class TestController {

    @GetMapping()
    public String echo(@RequestParam String message) {
        return message;
    }
}

How do I disable only the echo method, and not the whole controller?

0

There are 0 best solutions below