【问题标题】:Issue with Content Based routing基于内容的路由问题
【发布时间】:2017-11-26 08:35:06
【问题描述】:

您好,我正在尝试根据标头值路由到两个不同的速度模板文件

public void configure() throws Exception {
    from("direct:csi:aaa").bean(bbb.class, "transform").wireTap("direct:auditlog:request").choice()
            .when().simple("${in.header.ccc == 'true'}").to("velocity:vm/ddd.vm").otherwise()
            .to("velocity:vm/eee.vm").end().to("http4://headeruri?throwExceptionOnFailure=false")
            .convertBodyTo(String.class).wireTap("direct:auditlog:response")
            .bean(bbb.class, "processResponse").routeId("zzzRouteBuilder");
}

交易所在标头中有 ccc,这是真的,但它仍在使用 eee.vm

【问题讨论】:

  • 什么是 in.header.ccc ?它是一个领域吗?你在哪里设置这个字段?你需要进一步充实这个问题。

标签: java apache-camel placeholder


【解决方案1】:

简单定义有错误,应该是:

.when().simple("${in.header.ccc} == 'true'")

或者更简单的:

.when().simple("${in.header.ccc}")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-05
    • 2021-12-06
    • 2021-03-26
    • 1970-01-01
    相关资源
    最近更新 更多