Hi

When you upgrade Camel then please read the release notes, such as the
sections _changes that many affect.._ and _important changes..._.

In this case you can see how you can let on completion behave as before
http://camel.apache.org/camel-2140-release.html


On Thu, Oct 2, 2014 at 5:21 AM, Max Bridgewater
<max.bridgewa...@gmail.com> wrote:
> Some progress on this. It appears that in Camel 2.14, there is now an
> interface called SynchronizationRouteAware in addition to Synchronization.
> SynchronizationRouteAwarehas two additional methods onAfterRoute and
> onBeforeRoute.
>
> What I've done is implement onAfterRoute and call my completion logic
> there. I left onComplete and onBeforeRoute empty.
>
> Things seem to work well and the synchronization is called at the end of
> the route as it was the case with Camel 2.13. The only caveat now is that
> the synchronization is being called 3 times instead of just once.
>
> Why is this?
>
> My Synchronization looks as follows:
>
> exchange.getUnitOfWork().addSynchronization(
>                             SynchronizationRouteAware(){
>                         public void onAfterRoute(Route route,    Exchange
> exchange){
>                                 myCompletionLogic(exchange)
>                         }
>                         public void onBeforeRoute(Route route,  Exchange
> exchange){
>                             //Left Empty
>                         }
>                         public void      myCompletionLogic(Exchange x){
>                             //My completion logic here
>                         }
>                         public void      onComplete(Exchange x){
>                             //Left empty
>                         }
>                         public void      onFailure(Exchange x){
>                             //Left empty
>                         }
>
>                             }
>
>                         );
>
> On Wed, Oct 1, 2014 at 2:35 PM, Max Bridgewater <max.bridgewa...@gmail.com>
> wrote:
>
>> Hi,
>>
>> In Came 2.14, onCompletion now has a mode parameter that allows
>> controlling if the onCompletion body is to be executed after or before the
>> route consumer.
>>
>> How does this impact UnitOfWork? Is there a way to also control when a
>> synchronization is to be executed?
>>
>> I haven't fully isolated the issue yet. But I seem to have a case where
>> UnitOfWork was executed before the route consumer while with Camel 2.14, it
>> is not executed after the route consumer has started.
>>
>> Any thoughts?
>>
>> Regards,
>> Max.
>>
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to