【问题标题】:Apache Camel .when() Statement Only works half of the timeApache Camel .when() 语句只有一半的时间有效
【发布时间】:2017-08-28 15:44:30
【问题描述】:

我有一个包含多个 .when() 案例的 .choice() 语句。但是,我每次都上传相同的文件,其中 MsgFmtVerNr=2,有时它会转到其他文件,有时它会通过 .when().xpath("/UpsBas/MsgHdr/MsgFmtVerNr = '2'")。我不知道为什么这个声明只在一半的时间内有效。是否有某些原因会直接跳到 .otherwise() 语句?感谢您的帮助。

 .choice()
                .when(body().startsWith(constant("A")))
                    .setHeader(MsgHdr.EVENT_CODE, simple(ErrorCodesLocal.UNSOLICITEDMSG_GIC_BSIS))
                    .beanRef("fromGICRoute", "setMessageHeadersForUnsolicitedMessage(*)")
                    .beanRef("logging", "debug(*, 'Messsage from " + FromGicSourceQueue + " is a unsolicited message')")
                    .multicast().parallelProcessing()
                        .to("direct:unsolicitedMessageToBoss", "direct:unsolicitedMessageToCmods", "direct:unsolicitedMessageToIsps")
                    .endChoice()
                .when(body().contains("<RtgPfl"))
                    .to(RATING_PROFILE_DESTINATION_QUEUE)
                .when().xpath("/UpsBas/MsgHdr/MsgFmtVerNr = '2'")//body().contains("<MsgFmtVerNr>2<"))
                    .to("direct:cv2")
                .otherwise()
                    .to("direct:commercialInvoice")

【问题讨论】:

    标签: java apache apache-camel amq


    【解决方案1】:

    我发现你们中的那些人遇到了类似的问题。我有两个捆绑包链接到我的服务器上的同一个队列,所以一个文件上传会去,正确的捆绑包,而另一个会去不正确的捆绑包。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-04
      • 1970-01-01
      • 2012-06-09
      • 1970-01-01
      相关资源
      最近更新 更多