导入别的类中的bean
@Configuration class CommonContext { @Bean public MyBolt myBolt() { return new MyBolt(); } } ... @Configuration @Import(CommonContext.class) class ATopologyContext { // ... } @Configuration @Import(CommonContext.class) class BTopologyContext { // ... }