Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration Spring集成http:与Hystrix的出站网关_Spring Integration_Hystrix_Spring Integration Http - Fatal编程技术网

Spring integration Spring集成http:与Hystrix的出站网关

Spring integration Spring集成http:与Hystrix的出站网关,spring-integration,hystrix,spring-integration-http,Spring Integration,Hystrix,Spring Integration Http,是否有一种方法可以使用Hystrix命令包装http:outbound gateway REST API调用。我看到了一些关于使用自定义请求处理程序建议的参考,但不确定我将如何去做 请参见此处:。我不能以重复的形式结束你的问题,因为没有人投票支持我的答案。但仍然:相同的解决方案必须应用于您的用例: @ServiceActivator(inputChannel = "serviceChannel") @HystrixCommand(fallbackMethod = "serviceFallback

是否有一种方法可以使用Hystrix命令包装http:outbound gateway REST API调用。我看到了一些关于使用自定义请求处理程序建议的参考,但不确定我将如何去做

请参见此处:。我不能以重复的形式结束你的问题,因为没有人投票支持我的答案。但仍然:相同的解决方案必须应用于您的用例:

@ServiceActivator(inputChannel = "serviceChannel")
@HystrixCommand(fallbackMethod = "serviceFallback")
public String myService(String payload) {
    // Some external service call
}

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

另请参见我的sendbox中的示例:

请解释为什么您需要Hystrix,以及为什么您认为在http:Outbound的某个地方有类似于
的回退方法
,以便您可以应用Hystrix?