1
我有一個奇怪的行爲與onException塊。駱駝onException行爲與分割器
如果我將處理設置爲false,那麼不會打印SOME MESSAGE日誌,但如果將處理值更改爲true,則會記錄所有內容。有人能解釋發生了什麼嗎?據我所知,在這兩種情況下都應該打印日誌。
<camelContext ..>
<onException>
<exception>java.lang.Exception</exception>
<handled>
<constant>false</constant>
</handled>
<log message="SOME MESSAGE"/>
</onException>
<route>
<from uri="timer://foo?repeatCount=1"/>
<!-- Put a list with some values as a body -->
<to uri="bean:utils?method=setBody"/>
<split shareUnitOfWork="true" stopOnException="true">
<simple>${body}</simple>
<to uri="direct:handleSplit"/>
</split>
</route>
<route>
<from uri="direct:handleSplit"/>
<throwException ref="myException"/>
</route>
</camelContext>
如果使用shareUnitOfWork選項運行Java DSL版本,則行爲將會相同。 –