Apache camel ApacheCamel错误处理程序:SpringDSL

Apache camel ApacheCamel错误处理程序:SpringDSL,apache-camel,Apache Camel,我有一个关于在配置中添加ApacheCamel错误处理程序的问题。我认为我在做一些很愚蠢的事情,这可能是一个基本的错误 我想添加两种类型的错误处理 <camel:errorHandler id="errorHandler" type="DefaultErrorHandler" <camel:redeliveryPolicy maximumRedeliveries="0"/> </camel:errorHandler> 你让它工作了吗?只是抱怨吗?如果运行应

我有一个关于在配置中添加ApacheCamel错误处理程序的问题。我认为我在做一些很愚蠢的事情,这可能是一个基本的错误

我想添加两种类型的错误处理

<camel:errorHandler id="errorHandler" type="DefaultErrorHandler"
    <camel:redeliveryPolicy maximumRedeliveries="0"/>
</camel:errorHandler>

你让它工作了吗?只是抱怨吗?如果运行应用程序,它是否启动并工作?在Eclipse中,名称空间的缓存可能很旧。应该有一个重新配置的方法,等等。嗨,是的,对不起,我犯了几个愚蠢的错误,导致这不起作用。我发现OneException需要在路由中的from之后。如果我的路由中有三条sql语句,我是只需要在路由中指定OneException一次,还是需要在每条sql语句之后指定一次?还要防止camel在失败后重试maximumRedeliveries=“0”是否正确?这似乎对我不起作用。OneException可以在camelContext和route级别上配置。驼峰优先从路由中选择,然后回退到驼峰上下文级别。您只需要在路由中配置一次OneException。我建议从Camel网站/Camel书籍等阅读更多关于Camel错误处理的内容,以便更好地理解这一点。
<onException>
    <exception>java.sql.SQLException</exception>
    <redeliveryPolicy maximumRedeliveries="0"/>
    <to uri="log:xml?level=ERROR"/>
</onException>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="
          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">