Sure, I really appreciate your help. 

I had to take some (more or less sensitive :) ) snippets out, but this is 
essentially what it looks like :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="
                http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>

        <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"; 
errorHandlerRef="deadLetterErrorHandler">
        
                <route>
                        <from
                                uri="........" />
                        <choice>
                                <when>
                                        ......
                                </when>
                                <when>
                                        ......
                                </when>
                                <otherwise>
                                        <!-- status messages go to direct:out 
straight -->
                                        <to uri="direct:out" />
                                </otherwise>
                        </choice>
                </route>

                <route>
                        <from uri="seda:fairValuePricePipeline" />
                        <to uri="bean:fairValuePriceMessageValidator" />
                        <choice>
                                <when>
                                        ......
                                </when>
                                <otherwise>
                                        <to uri="direct:fallbackPriceSelector" 
/>
                                </otherwise>
                        </choice>
                </route>

                <route errorHandlerRef="deadLetterErrorHandler"> 
                        <from uri="seda:bondfloorPricePipeline" />
                        <to uri="bean:bondfloorPriceMessageValidator" />
                        <choice>
                                <when>
                                        ......
                                </when>
                                <otherwise>
                                        <to uri="direct:fallbackPriceSelector" 
/>
                                </otherwise>
                        </choice>
                </route>

                <route>
                        <from uri="direct:fallbackPriceSelector" />
                        <to uri="bean:fallbackPriceSelector" />
                        <to uri="direct:out" />
                </route>
                
                <route>
                        <from uri="seda:deadletterQueue" />
                        <to uri="direct:out" />
                </route>

                <route>
                        <from uri="direct:out" />
                        <to uri="........." />
                </route>

        </camelContext> 

        <bean id="deadLetterErrorHandler" 
class="org.apache.camel.builder.DeadLetterChannelBuilder">
                <property name="deadLetterUri" value="seda:deadletterQueue"/>
                <property name="handled" value="false" />
        </bean>

        ..........      some processor beans ........
        

        <bean id="propertyConfigurer" 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
                <property name="searchSystemEnvironment" value="true" />
        </bean>

        <bean id="log4jInitialization" 
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
                <property name="targetClass" 
value="org.springframework.util.Log4jConfigurer" />
                <property name="targetMethod" value="initLogging" />
                <property name="arguments">
                        <list>
                                
<value>${SOME_HOME}/etc/config/log4j/log4j.properties</value>
                        </list>
                </property>
        </bean>
</beans>

I end up having a DeadLetterChannel error handler in the 
seda:bondfloorPricePipeline (the one which has set the error handler at route 
level) and the DefaultErrorHandler anywhere else, which is not what we would 
expect, right ? (The routes themselves are working nicely without error 
handling configured.)

Thank you, Christian.

-----Original Message-----
From: Claus Ibsen [mailto:[email protected]] 
Sent: Mittwoch, 26. August 2009 11:18
To: [email protected]
Subject: Re: Global Error Handler Question.

Hi

It should really work as we got a ton of unit tests in relation to
error handling.

Could you post your spring xml file with the camel context and routes
that you cannot get working?


On Wed, Aug 26, 2009 at 11:02 AM, Bach
Christian<[email protected]> wrote:
> Heya guys
>
> I am trying to install a global error handler by setting :
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";
> errorHandlerRef="deadLetterErrorHandler">
>
> in the camelContext, according to
> http://camel.apache.org/error-handler.html the error handler is expected
> to be inherited and being applicable in all the routes, ya ?
>
> But it is not, when inspecting stack traces I see the
> DefaultErrorHandler still being applied in all my routes. When
> configuring individual routes, like:
>
> <route errorHandlerRef="deadLetterErrorHandler">
>
> things are working nicely and my stack traces for the particular route
> do have the DeadLetterChannel installed.
>
> I must be doing something wrong in my attempt of globally configuring
> matter. The Camel version used is 2.0.0 and the deadLetterErrorHandler
> is configured like this:
>
> <bean id="deadLetterErrorHandler"
> class="org.apache.camel.builder.DeadLetterChannelBuilder">
>        <property name="deadLetterUri" value="seda:deadletterQueue"/>
>        <property name="handled" value="false" />
> </bean>
>
> Any help appreciated, thx, Christian.
>
> This message is for the named person's use only. It may contain confidential, 
> proprietary or legally privileged information. If you receive this message in 
> error, please notify the sender urgently and then immediately delete the 
> message and any copies of it from your system. Please also immediately 
> destroy any hardcopies of the message.
> The sender's company reserves the right to monitor all e-mail communications 
> through their networks.
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to