Dynamic routing in camel en-queues messages infinitely

烈酒焚心 提交于 2019-12-06 15:02:08
Claus Ibsen

Read the documentation about dynamic router at

And see the beware box, it says the method must return null to signal to the dynamic router to break out.

So in your code above, then this code line

RecordObject record = obj.getRecordObject();

... the record object is never null and therefore the dynamic router keeps going forever.

If you only want this dynamic routing one time then use the dynamic receipient list eip instead, see

And your xml route is

<recipientList>
<!-- use a method call on a bean as dynamic router -->
<method ref="messageRouter" method="route" />
</recipientList>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!