Camel:关于com.my.FatalException或其subcleass的SpringDSL关闭路由

时间:2014-04-09 18:11:08

标签: apache-camel

使用Camel 11,可能会升级到13.0:

Req:如果路由的某些部分抛出FatalException或其子类,则应该停止路由。我如何在SpringDSL的 onExpression 部分表达这一点。如果那不是正确的地方,那么正确的地方是什么?

    <onException>

        <exception>eri.odapp.OdAppFatalException or its subclass</exception>

        <log loggingLevel="ERROR" message="A fatal error happend in route <routeName> while processing file: ${header.CamelFileName}, Shutting down the route  " />

        <!--  Shut down the route where this fatal exception happened (so admins can rectify the scenario and restart the flow)-->

    </onException>

致命异常层次结构:

public class OdAppException extends RuntimeException 
public class OdAppIOException extends OdAppFatalException
public class OdAppDataAccessException extends OdAppFatalException

1 个答案:

答案 0 :(得分:0)

与您的问题略有不同的背景,但也许这个线程适用于此?

Stop routing in otherwise clause

也可能感兴趣:

camel FAQ on stopping routes

(注意:可能是这个评论而不是答案但由于积分/声誉而没有这个选项)

相关问题