I'm facing this kind of issue now, that I must give two conditions in one @ConditionalOnProperty
which is class level.
I have a bean, say
@RestController
@RequestMapping("/blablabla")
@ConditionalOnProperty(prefix = "my.property.value1", name = "enabled", havingValue = "true")
public class MyBean{}
now there is a requirement that MyBean
must be loaded based on two conditions, one is my.property.value1.enabled:true
and the second is my.property.value2:true
(both coming from application.yml file)
Now my question is there any way of doing this in one @ConditionalOnProperty
annotation, if yes, so please paste here the working example. Thanks in advance.