仅重试500次回复

时间:2017-04-07 14:47:58

标签: apache-camel

我只想在500错误上重试传递,但似乎无法找到将异常范围限制为只有该状态代码的方法。我的代码:

onException(HttpOperationFailedException.class)
                .handled(true)
                .maximumRedeliveries(5)
                .redeliveryDelay(200);

.to("http4://localhost:8088/ws/v1/camel?bridgeEndpoint=true&throwExceptionOnFailure=false")

1 个答案:

答案 0 :(得分:1)

参见Camel in Action书(第1版或第2版),它在错误处理程序章节的末尾有一个这样的例子。

你只需在onException中添加一个onWhen然后添加一些代码来检查状态代码是否为500

相关问题