【问题标题】:Show request in Camel route在骆驼路线中显示请求
【发布时间】:2014-02-09 11:02:58
【问题描述】:

有没有办法在骆驼路线中记录来自正文的请求?

<camel:log message="RequestType [${request.body.request}]" loggingLevel="INFO" />

日志中的错误:

Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: request.body.request

这是工作部分,但不知道如何进入现场:

        <camel:log message="RequestType ${in.body}" loggingLevel="INFO" />
        <camel:log message="RequestType2 [${body}]" loggingLevel="INFO" />

请求字段确保它不为空,因为稍后我会检查它:

<camel:ognl>request.body.request instanceof ...

【问题讨论】:

    标签: integration apache-camel esb


    【解决方案1】:

    试试

    <camel:log message="RequestType [${body.request}]" loggingLevel="INFO" />
    

    camel:log 使用的是简单的语言,您可以在此处阅读更多信息:http://camel.apache.org/simple

    【讨论】:

    • 错误 [Camel (ccgwContext) 线程 #3 - 线程] coreV2:145 - 处理路线 v2.0 时发生意外异常 [无法调用方法:.request on null 由于:org.apache .camel.language.bean.RuntimeBeanExpressionException:无法调用方法:null 请求 过了一会儿我正在使用它并且它正在工作,这是奇怪的原因:request.body.request instanceof pl.gtp.vas.ccgw .model.transport.ChargeRequest
    • 如果你记录 ${body} 和 ${body.class} 会说明什么?
    • 它有效,我将收到正文中的所有字段。也请!
    • 但是我仍然不能只收到一个像 body.request 这样的字段... =/ 不知道为什么
    • 好吧,可能是因为我身上有两个相同命名的类型......这不是骆驼的错误。感谢您的帮助!
    猜你喜欢
    • 2015-05-11
    • 1970-01-01
    • 2022-08-08
    • 2018-09-05
    • 2011-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-29
    相关资源
    最近更新 更多