Apache Camel Route Multicast 不会复制交换消息



我在应用程序中用spring dsl做了一个camel route。我想使用 EIP 复制exchange body multicast。但是当我使用它时,我可以从我的一个endpoint中获取exchange body.在第二个(在组播中是端点),交换体是null。为什么会这样?

编辑这是我的路线:

<route errorHandlerRef="dlc1" id="mobitRoute1">
            <from uri="cxf:bean:mobit-okuma?dataFormat=PAYLOAD" />
            <wireTap uri="activemq:queue:anaMobitQueue" />
            <to uri="velocity:response.vm" />
        </route>
        <route id="mobitRoute2" errorHandlerRef="dlc2">
            <from uri="activemq:queue:anaMobitQueue" />
            <unmarshal ref="myJaxb" />
            <to uri="bean:timeChanging" />
            <multicast>
                <to uri="activemq:queue:mobitOkumaq" />
                <to uri="activemq:queue:AysMobit" />
            </multicast>
        </route>
        <route errorHandlerRef="dlc3" id="mobitRoute3">
            <from uri="activemq:queue:AysMobit" />
            <!-- <unmarshal ref="myJaxb" /> -->
            <to uri="bean:fromPayload" />
            <to uri="cxf:bean:ays-service?dataFormat=POJO" />
        </route>
        <route errorHandlerRef="dlc4" id="mobitRoute4">
            <from uri="activemq:queue:mobitOkumaq" />
            <to uri="cxf:bean:mobit-okumaReal?dataFormat=POJO" />
        </route>

当我将交换放入队列时,我通过转换 xml 找到了解决方案。这是为什么?我不知道。

<route errorHandlerRef="dlc1" id="mobitRoute1">
            <from uri="cxf:bean:mobit-okuma?dataFormat=PAYLOAD" />
            <wireTap uri="activemq:queue:anaMobitQueue" />
            <to uri="velocity:response.vm" />
        </route>
        <route errorHandlerRef="dlc1" id="mobitRoute2">
            <from uri="activemq:queue:anaMobitQueue" />
            <camel:pipeline>
                <unmarshal ref="myJaxb" />
                <to uri="bean:timeChanging" />
                <!-- <to uri="direct:unmarshalled"/> -->
                <marshal ref="myJaxb" />
                <camel:multicast>
                    <to uri="activemq:queue:BegisMobit" />
                    <to uri="activemq:queue:AysMobit" />
                </camel:multicast>
            </camel:pipeline>
        </route>

        <route errorHandlerRef="dlc2" id="mobitRoute3">
            <from uri="activemq:queue:AysMobit" />
            <unmarshal ref="myJaxb" />
            <to uri="bean:fromPayload" />
            <to uri="cxf:bean:ays-service?dataFormat=POJO" />
        </route>
        <route errorHandlerRef="dlc3" id="mobitRoute4">
            <from uri="activemq:queue:BegisMobit" />
            <unmarshal ref="myJaxb" />
            <to uri="cxf:bean:mobit-okumaReal?dataFormat=POJO" />
        </route>

最新更新