我想用重试和 Hystrix 断路器实现 Apache Camel 路由。我的路线如下所示:
<route>
......
<onException>
<exception>java.lang.Exception</exception>
<redeliveryPolicy redeliveryDelay="150" maximumRedeliveries="3" logRetryAttempted="true" retryAttemptedLogLevel="WARN"/>
</onException>
<hystrix>
<hystrixConfiguration id="MyServiceHystrix" />
<to uri="{{my.service.endpoint}}?bridgeEndpoint=true"/>
</hystrix>
</route>
当在Hystrix 命令线程中调用骆驼 http4 端点时,CamelInternalProcessor
不会调用RedeliveryErrorHandler
并且没有重试。基本上堆栈跟踪尊重是:
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
有人知道为什么会这样吗?我可以在不拆分路线的情况下将两者结合起来吗?