I have a component that I what to be able to enable/disable from the applikation.properties in my spring boot application..
In my application.properties I have
wiki.enabled=false
And in component looks like this
@Component
@ConditionalOnProperty("wiki.enabled")
public class WikiClient {
...
}
And finally in my other class where I use the wikiclient I have autowired it like this in my constructor.
@Autowired(required = false)
public MigrationManager(UserService userService, WikiClient wikiClient) {
...
}
Still I get the exception
No qualifying bean of type com.test.WikiClient
If I enable the property it works like if I enabled the component.