Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目中使用@EnableFeignClients后Graphql方法注册失败,无法调用 #27

Closed
wangyuheng opened this issue Nov 16, 2020 · 1 comment · Fixed by #39
Closed

项目中使用@EnableFeignClients后Graphql方法注册失败,无法调用 #27

wangyuheng opened this issue Nov 16, 2020 · 1 comment · Fixed by #39
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wangyuheng
Copy link
Owner

wangyuheng commented Nov 16, 2020

背景

项目引用arc-graphql并通过feign调用3方httpapi

现象

项目中增加 @EnableFeignClients 后 graphql无法调用

期望

能够同时使用 arc-graphql 及 feign

原因

feignClient 在注册过程中 FeignContext 会 调用父类NamedContextFactorycontext.refresh(); 方法,并发送事件 ContextRefreshedEvent

@wangyuheng wangyuheng added the bug Something isn't working label Nov 16, 2020
@wangyuheng wangyuheng added this to the 1.2.0 milestone Nov 16, 2020
@wangyuheng wangyuheng self-assigned this Nov 16, 2020
@wangyuheng
Copy link
Owner Author

临时解决方案: 在 GraphQLProvider 中忽略 onApplicationEvent,通过lazy方式在首次请求时执行初始化

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        log.info("receive event:{}", event);
        refresh();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant