You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "valerian.merkling" <va...@capgemini.com> on 2013/12/24 16:00:44 UTC

On Exception and OnRedeliver behavior

Hi !

I would like to have a single bean to process every errors and be able to
choose inside this bean if the error is recoverable or not, and then if the
message shall be redelivered or not.

What i've done : 


 <camel:camelContext id="mil-ares-colisage-in"
xmlns="http://camel.apache.org/schema/spring">
        <onException>
            <exception>example.UnrecoverableException</exception>
            <handled>
                <constant>true</constant>
            </handled>       
			<to uri="unrecovermanager"/>     
            <to uri="activemq:queue:unrecoverable-error" />
        </onException>
        <onException onRedeliveryRef="errormanager" >
            <exception>java.lang.Exception</exception>
			 <redeliveryPolicy  maximumRedeliveries="5" redeliveryDelay="100"  />
            <handled>
                <constant>true</constant>
            </handled>            
        </onException>
		
	...


And in the /errormanager/ i just throw a new /UnrecoverableException /if
needed.

In my memory, two month ago i made some test and this structure worked.
Right now, while testing my bus, it does not work anymore. The
/UnrecoverableException / is thrown somewhere in space and ignored.

So what's wrong ? Is it supposed to work ? Is Throwing an exception in a
redeliver processor supposed to be catched again by the OnException clause ?
Or shall i find another way to do it ?

Thanks for your help !

Regards, 

Valerian Merkling



--
View this message in context: http://camel.465427.n5.nabble.com/On-Exception-and-OnRedeliver-behavior-tp5745208.html
Sent from the Camel - Users mailing list archive at Nabble.com.