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和管道标签放在一起,但是那里有编译错误。