我正在使用Camel 2.9.2并定义了OnCompletion路由如下:
<onCompletion onFailureOnly="true">
<log message="Nack On Failure:Status=$simple{header.CXAckStatus}:Error=$simple{header.CXAckError}" loggingLevel="DEBUG"/>
<process ref="ackMessageProcessor" />
<to uri="file://{{file.writer.dir}}"/>
</onCompletion>
提供于 出于某种原因https://stackoverflow.com/questions/18877562/how-can-i-log-a-header-value-in-camel-using-spring-dsl解决方案对我不起作用。
我可以看到一些与路线定义相关的Camel跟踪Line 5309: 2017-07-28 11:14:53,830 DEBUG [Thread-11] (RouteService.java:311) - Starting child service on route: writingRoute -> OnCompletionProcessor[UnitOfWork(UnitOfWork(RouteContextProcessor[Pipeline[[Channel[Log(writingRoute)[Nack On Failure:Status=$simple{header.CXAckStatus}:Error=$simple{header.CXAckError}]], Channel[sendTo(Endpoint[log://'Ack On Success:Status=$simple{header.CXAckStatus}:Error=$simple{header.CXAckError}' ])],
但是没有找到标题值的实际记录消息......
我需要配置其他任何东西。