【问题标题】:Camel XML config using header values in endpoint URICamel XML 配置使用端点 URI 中的标头值
【发布时间】:2014-05-28 18:15:42
【问题描述】:

我想用 Spring XML 骆驼上下文表示法来写这个等价物。

                from("rabbitmq:resultQueue")
                    .filter(header("synchronousRequestId").isEqualTo(
                            synchronousRequestId))
                    .to("seda:" + synchronousRequestId).onCompletion()
                    .stop();

我不知道该怎么做..

.to("seda:" + synchronousRequestId)

因为 synchronousRequestId 是标头参数,而不是字符串常量。

有什么想法吗?

【问题讨论】:

    标签: xml spring apache-camel


    【解决方案1】:

    它的 XML 版本是:

    <recipientList>
         <simple>seda:${headers.synchronousRequestId}</simple>
    </recipientList>
    

    【讨论】:

      【解决方案2】:

      Apache Camel website's FAQ找到答案

      使用收件人列表 EIP 模式,它允许您使用表达式计算动态 URI。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-05-21
        • 2012-03-18
        • 2015-12-29
        • 1970-01-01
        • 2016-04-14
        • 1970-01-01
        • 2014-05-12
        • 1970-01-01
        相关资源
        最近更新 更多