spring某些类只有在prod环境生效并加载bean
@Profile("prod") // 只有prod的profile环境下,spring才会加载bean到容器中过去
@Component
@Slf4j
@Profile("prod")
public class UmpAlarmMqConsumer implements IStoppable, InitializingBean {
@Override
public void stop(String cause) {
log.info("stop from {}", cause);
}
@Override
public void afterPropertiesSet() throws Exception {
}
}
标签:Profile,spring,生效,Override,prod,cause,public
From: https://www.cnblogs.com/PythonOrg/p/17514641.html