亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

重新發送到Kafka主題時,駱駝中的無限循環

重新發送到Kafka主題時,駱駝中的無限循環

幕布斯6054654 2021-05-11 17:30:18
我們將消息發送到Kafka主題,然后通過駱駝路由發送到ActiveMQ主題,一切都如預期的那樣進行。但是現在,我們有了另一條路由,將消息Arrivive從ActiveMQ主題發送到Kafka的另一個主題,這就是Camel進入無限循環的位置。這是我的路線XML。為什么這種類型的配置會導致無限循環?<!--DEFINE KAFKA'S TOPCIS AS ENDPOINT-->            <endpoint id="tagBlink" uri="kafka:10.0.0.165:9092">                <property key="topic" value="tagBlink"/>                <property key="brokers" value="10.0.0.165:9092"/>            </endpoint>        <!--END OF KAFKA'S TOPICS's AS ENDPOINT-->            <endpoint id="testMike" uri="kafka:10.0.0.165:9092">                <property key="topic" value="testMike"/>                <property key="brokers" value="10.0.0.165:9092"/>            </endpoint>         <!-- Route from Kafka (otherMessage) to ActiveMQ (wherenet.flow.deliveryNotificationProducer)-->        <route id="route1">            <from uri="ref:tagBlink"/>                <!--<process ref="transformToXML" />-->            <to uri="activemq:topic:myTopic"/>                        <log message="Routing message from Kafka"/>        </route>        <route id="routeAutoGeneratedAMQ">              <from uri="activemq:topic:myTopic" />                               <to uri="ref:testMike"/>            <to uri="stream:out" />        </route>
查看完整描述

1 回答

?
皈依舞

TA貢獻1851條經驗 獲得超3個贊

好了,經過一些測試,我在Camel Configuration中讀取了此參數


bridgeEndpoint  Default:false   Camel 2.16.0: If bridgeEndpoint is true, the producer will ignore the topic header setting of the message.

因此,我嘗試添加到我的終點


        <!--DEFINE KAFKA'S TOPCIS AS ENDPOINT-->

            <endpoint id="tagBlink" uri="kafka:10.0.0.165:9092">

                <property key="topic" value="tagBlink"/>

<property key="topic" value="tagBlink"/>

                <property key="brokers" value="10.0.0.165:9092"/>

                  <property key="bridgeEndpoint " value="true"/>

            </endpoint>

        <!--END OF KAFKA'S TOPICS's AS ENDPOINT-->


            <endpoint id="testMike" uri="kafka:10.0.0.165:9092">

                <property key="topic" value="testMike"/>

                 <property key="brokers" value="10.0.0.165:9092"/>

                  <property key="bridgeEndpoint " value="true"/>


            </endpoint>

并且無限循環停止了。


查看完整回答
反對 回復 2021-05-26
  • 1 回答
  • 0 關注
  • 149 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號