You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by siddhesh <si...@persistent.co.in> on 2016/01/05 04:45:14 UTC

Exception from idempotentConsumer not propagating to onException

Hi All,

I have camel route in which I am using idempotentConsumer. I got
exceptionhandler added for the route.

 <route id="executeIdempotentLogicRoute">
            <from uri="direct:executeIdempotentLogicRoute" />
            <onException>
                <exception>java.lang.Exception</exception>
                <handled>
                    <constant>false</constant>
                </handled>
                <bean ref="onExceptionProcessor"
method="process(*,'basicRoute','basicRoute2')" />               
            </onException>
            <setHeader headerName="messageId">
                <simple>${body.getCode}</simple>
            </setHeader>
            <setHeader headerName="clientId">
                <simple>${body.getid}</simple>
            </setHeader>
            <when>
                <simple>${body.getClientId} != null</simple>
                <idempotentConsumer
messageIdRepositoryRef="messageIdRepository" skipDuplicate="false">
                    <header>messageId</header>
                    <filter>
                        <to uri="direct:returnResponse" />
                        <stop />
                    </filter>
                </idempotentConsumer>
            </when>
        </route>
My IdempotentRepository  is JDBCIdempotentRepository. When
org.springframework.dao.DataAccessException is thrown from my
IdempotentRepository, 
I can't get it in onException.  Process method of onExceptionProcessor
dosent gets called.

Any idea why this is occurring ? 



--
View this message in context: http://camel.465427.n5.nabble.com/Exception-from-idempotentConsumer-not-propagating-to-onException-tp5775779.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exception from idempotentConsumer not propagating to onException

Posted by siddhesh <si...@persistent.co.in>.
Thanks Claus. 



--
View this message in context: http://camel.465427.n5.nabble.com/Exception-from-idempotentConsumer-not-propagating-to-onException-tp5775779p5775795.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exception from idempotentConsumer not propagating to onException

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for reporting. I have reproduced the issue and logged a ticket
https://issues.apache.org/jira/browse/CAMEL-9480

On Tue, Jan 5, 2016 at 9:27 AM, siddhesh
<si...@persistent.co.in> wrote:
> Hi Claus, Sorry I dint mention Camel version. I am facing this issue on
> 2.10.0 and even on 2.15.2
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exception-from-idempotentConsumer-not-propagating-to-onException-tp5775779p5775784.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Exception from idempotentConsumer not propagating to onException

Posted by siddhesh <si...@persistent.co.in>.
Hi Claus, Sorry I dint mention Camel version. I am facing this issue on
2.10.0 and even on 2.15.2



--
View this message in context: http://camel.465427.n5.nabble.com/Exception-from-idempotentConsumer-not-propagating-to-onException-tp5775779p5775784.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exception from idempotentConsumer not propagating to onException

Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel do you use? And have you tried testing it with a
newer release?

On Tue, Jan 5, 2016 at 4:45 AM, siddhesh
<si...@persistent.co.in> wrote:
> Hi All,
>
> I have camel route in which I am using idempotentConsumer. I got
> exceptionhandler added for the route.
>
>  <route id="executeIdempotentLogicRoute">
>             <from uri="direct:executeIdempotentLogicRoute" />
>             <onException>
>                 <exception>java.lang.Exception</exception>
>                 <handled>
>                     <constant>false</constant>
>                 </handled>
>                 <bean ref="onExceptionProcessor"
> method="process(*,'basicRoute','basicRoute2')" />
>             </onException>
>             <setHeader headerName="messageId">
>                 <simple>${body.getCode}</simple>
>             </setHeader>
>             <setHeader headerName="clientId">
>                 <simple>${body.getid}</simple>
>             </setHeader>
>             <when>
>                 <simple>${body.getClientId} != null</simple>
>                 <idempotentConsumer
> messageIdRepositoryRef="messageIdRepository" skipDuplicate="false">
>                     <header>messageId</header>
>                     <filter>
>                         <to uri="direct:returnResponse" />
>                         <stop />
>                     </filter>
>                 </idempotentConsumer>
>             </when>
>         </route>
> My IdempotentRepository  is JDBCIdempotentRepository. When
> org.springframework.dao.DataAccessException is thrown from my
> IdempotentRepository,
> I can't get it in onException.  Process method of onExceptionProcessor
> dosent gets called.
>
> Any idea why this is occurring ?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exception-from-idempotentConsumer-not-propagating-to-onException-tp5775779.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2