Hi

Could you try to move the onException outside the from tag?

It should be like this:

<route>
   <onException>
   </onException
   <from>
    ...
</route>

If you enable DEBUG logging for org.apache.camel you will set that it
will try to find which onexception to use when the exception is
thrown. Something like this:

2008-11-20 11:36:57,062 [main           ] DEBUG
DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception
org.apache.camel.processor.onexception.MyTechnicalException
2008-11-20 11:36:57,062 [main           ] DEBUG
DefaultExceptionPolicyStrategy - Using Exception[[class
org.apache.camel.processor.onexception.MyTechnicalException] -> []] as
the exception policy


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Wed, Nov 19, 2008 at 1:13 PM, Fush <[EMAIL PROTECTED]> wrote:
>
> Thanks for looking into it. I've come across one more behavior, that I don't
> quite understand: Given the route below, if the method in myOwnErrorHandler
> throws an exception (ie my own errorhandling fails), the message is
> redelivered 5 times. Can this be configured somehow (where), or am I
> supposed to handle this manually in the myOwnErrorHandler bean? Basically,
> what are my options for configuring and/or manually implementing the
> <onException> handling? I can't seem to find much documentation/examples for
> it.
>
> <camelContext id="myRouting"
>        xmlns="http://activemq.apache.org/camel/schema/spring";>
>        <route>
>                <from uri="activemq:queue/myQueue/aQueue" />
>                <choice>
>                       <when>
>                                <xpath>//type = 'myType'</xpath>
>                                <onException>
>
> <exception>org.my.exception.FunctionalException
>                                        </exception>
>                                        <redeliveryPolicy
> maximumRedeliveries="0" />
>                                        <handled>
>                                                <constant>true</constant>
>                                        </handled>
>                                        <to uri="bean:myOwnErrorHandler" />
>                                </onException>
>                                <unmarshal>
>                                        <jaxb prettyPrint="true"
> contextPath="org.my.domain.message" />
>                                </unmarshal>
>                                <to uri="bean:myBean" />
>                        </when>
>                </choice>
>        </route>
> </camelContext>
> --
> View this message in context: 
> http://www.nabble.com/1.5-error-handling-Spring-config-buggy-not-complete--tp20562554s22882p20578586.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Reply via email to