Reputation: 2069
I have tried to using @ConditionalOnProperty for disable/enable the spring boot endpoint, but its not working as expected. I want to disable/enable specific end points based on conditional values not the entire controller.
Upvotes: 4
Views: 5423
Reputation: 6302
Extract those methods to a new Controller. Then add the @ConditionalOnProperty to that Controller.
@ConditionalOnProperty works for @Bean, @Controller, @Service, ... objects, not for methods.
Upvotes: 11