I have a question about Spring annotation configurations. I have a bean:
@Bean
public ObservationWebSocketClient observationWebSocketClient(){
log.info(&
For Spring Boot 2+ you can simply use:
@Profile("prod")
or
@Profile({"prod","stg"})
That will allow you to filter the desired profile/profiles, for production or staging and for the underlying Bean using that annotation it only will be loaded by Springboot when you set the variable spring.profiles.active is equals to "prod" and ("prod" or "stg"). That variable can be set on O.S. environment variables or using command line, such as -Dspring.profiles.active=prod.