0
我使用apache camel xml dsl在路由上創建。 而我想用errorHandlerRef處理異常。但是這隻能用於路由標記。 這裏是我的路由上下文:我該如何處理Apache Camel的管道級別的execption?
<routeContext id="myRoute" xmlns="http://camel.apache.org/schema/spring">
<route errorHandlerRef="myErrorHandler" id="myErrorRoute">
<from uri="activemq:queue:{{my.queue}}" />
<multicast>
<pipeline>
//setting headers and other properties
<to uri="spring-redis://localhost:6379?serializer=#stringSerializer" />
</pipeline>
<pipeline>
//want to put error handling here
<log message="Insert to DB" />
<to uri="mybatis:insertToDB?statementType=InsertList"></to>
</pipeline>
</multicast>
</route>
</routeContext>
有沒有什麼辦法可以處理流水線級的異常。 例如,在這裏我想爲這兩個管道創建不同的錯誤處理程序。我怎樣才能做到這一點? 我試着把errorHanlerRef和管道標籤放在一起,但是那裏有編譯錯誤。