SpringBoot 的 静态方法获取静态变量,获取配置信息:
@Component
public class A {
@Value("${blade.redission-delay.delay-queue}")
private String temp;
private static String blockingQueue;
@PostConstruct
public void setBlockingQueue() {
blockingQueue = this.temp;
}
}
这样就可以在任何静态方法直接调用A.blockingQueue 变量了



