camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Mak <sander...@gmail.com>
Subject Re: Unexpected interceptor behavior
Date Mon, 20 Jun 2011 19:11:58 GMT
Ok, my intuition was that using the producer template the exchange
would be put 'on route' (the activemq endpoint is the first endpoint
on the route, right?). Apparently my intuition was wrong.

However, that still leaves me with the question of how to achieve my
goal without introducing an additional endpoint. Any pointers how I
can alter the route behavior to test my onException route?

Thanks!

On Mon, Jun 20, 2011 at 7:22 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> The webpage states that the Exchange has to be *on route*
> http://camel.apache.org/intercept
>
> Sending using producer template is not on route.
>
> On Mon, Jun 20, 2011 at 4:33 PM, Sander Mak <sandermak@gmail.com> wrote:
>> Hi all,
>>
>> I'm trying to test an onException handler of my route by intercepting
>> a send on the main route and throwing an appropriate exception so that
>> the onException handling  is triggered. However, I ran into some
>> unexpected behavior. A simplified testcase reproduces this behavior:
>> http://pastebin.com/L5Wuuy4P
>>
>> I expect that the interceptSendToEndpoint on line 49 is triggered by
>> the message that is sent on line 69 using a producer template.
>> However, the interception is never performed, hence the exception is
>> never thrown and the testcase fails with "Success" != "Error".
>>
>> However, while experimenting a bit I found out that I could get the
>> testcase to succeed by introducing a dummy direct endpoint in my main
>> route, and intercepting that endpoint instead of the activemq
>> endpoint: http://pastebin.com/PdK6gTNb  (diff with previous failing
>> testcase: http://pastebin.com/vdHghPB1 )
>>
>> For me this was unexpected. How can I get my original testcase to
>> succeed without altering my route?
>>
>>
>> Thanks,
>>
>> Sander
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Mime
View raw message