I have a question about Spring annotation configurations. I have a bean:
@Bean
public ObservationWebSocketClient observationWebSocketClient(){
log.info("creating web socket connection...");
return new ObservationWebSocketClient();
}
and I have a property file:
@Autowired
Environment env;
In the property file I want to have a special boolean property
createWebsocket=true/false
which signs whether a bean ObservationWebSocketClient should be created. If property value is false I don't want to establish web socket connection at all.
Is there any technical possibility to realize this?