Important point to note while using condition
@Value
property injection i.e. no other spring beans can be injected within it.BeanFactoryPostProcessor
and take care to never interact with bean instances. The restrictions refereed here are A BeanFactoryPostProcessor
may interact with and modify bean definitions, but never bean instances. Doing so may cause premature bean instantiation, violating the container and causing unintended side-effects.