首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring-Integration http:outbound-gateway with Hystrix

Spring-Integration http:outbound-gateway with Hystrix
EN

Stack Overflow用户
提问于 2018-05-02 07:13:14
回答 1查看 107关注 0票数 0

有没有办法用Hystrix命令包装一个http:outbound gateway REST API调用?我看到了一些使用自定义请求处理程序建议的参考,不确定我该如何去做。

EN

回答 1

Stack Overflow用户

发布于 2018-05-02 21:09:03

请看这里:Wrap spring integration outbound gateway calls with hystrix command。我不能以duplicate的身份结束你的问题,因为没有人投票支持我的答案。但仍然:同样的解决方案必须应用于您的用例:

代码语言:javascript
复制
@ServiceActivator(inputChannel = "serviceChannel")
@HystrixCommand(fallbackMethod = "serviceFallback")
public String myService(String payload) {
    // Some external service call
}

public String serviceFallback(String payload) {
    // some fallback logic
}

另请参阅我的发件箱中的示例:https://github.com/artembilan/sendbox/tree/master/spring-integration-with-hystrix

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50125060

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档