【发布时间】:2019-07-25 09:56:09
【问题描述】:
在我添加以下类之前,我的 springboot 应用运行良好:
@Service
@RequiredArgsConstructor
public class AutoopsClientPostBootListener implements ApplicationListener<ContextRefreshedEvent>
{
private final IAutoOpsGnsFlowInitiator gnsFlowInitator;
@Override
public void onApplicationEvent(ContextRefreshedEvent event)
{
gnsFlowInitator.startClient(event);
}
}
在那之后出于某种奇怪的原因,我得到了一个循环依赖错误,源于 feign client 依赖于上面的 AutoopsClientPostBootListener。
这是因为 IAutoOpsGnsFlowInitiator 依赖于依赖于 AutoopsClientPostBootListener 的 feign 客户端。但是FeignClient甚至没有任何成员..(feign自动生成)那它怎么可能依赖于Listener?!!
有什么问题??
感谢您的帮助
【问题讨论】:
标签: spring-boot spring-cloud-feign