You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stefan Burkard <sb...@gmail.com> on 2012/05/02 16:36:35 UTC
Message loss with transacted CXF consumer
Hi
The facts:
- InOnly route
- CXF bean consumes with "transacted" from JMS queue
=> therefore I expect the message to succeed or to go to JMS-DLQ
Result: CXF consumer commits JMS message in any case - no matter if
exceptions occur in route. If an error occurs during route processing
the message is lost.
Conclusion: "transacted" is currently useless if CXF is used with InOnly
Suggestions: Mark the route as InOut => did not help
Attached is a small maven project that illustrates the problem with unittests.
One solution would of course be to handle ALL route errors with a
Camel error handler, but this is more of a workaround. I am wondering
if there is a real solution for this problem.
Thanks
Stefan
Message loss with transacted CXF consumer
Posted by Stefan Burkard <sb...@gmail.com>.
Hi Daniel
Oh, I forgot that in my example and it actually solves the problem!
Interesting is that I gave that a try in my real project and it didn't
work then. But that was on Camel 2.2 and the example-test is on Camel
2.9.x.
Conclusion: I will try that again on my real project, since it was
migrated recently to Camel 2.8.x
By the way: the correct property name is
"org.apache.cxf.interceptor.OneWayProcessorInterceptor.USE_ORIGINAL_THREAD"
Thanks a lot for your help!
Stefan
On Wed, May 2, 2012 at 7:33 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> Can you try setting the property:
>
> org.apache.cxf.interceptor.USE_ORIGINAL_THREAD, "true"
>
> on the CXF endpoint and seeing if that helps? That should keep the request
> on the original thread and should allow the stack for that to unwind on an
> exception.
>
> Dan
>
>
> On Wednesday, May 02, 2012 04:36:35 PM Stefan Burkard wrote:
>> Hi
>>
>> The facts:
>> - InOnly route
>> - CXF bean consumes with "transacted" from JMS queue
>> => therefore I expect the message to succeed or to go to JMS-DLQ
>>
>> Result: CXF consumer commits JMS message in any case - no matter if
>> exceptions occur in route. If an error occurs during route processing
>> the message is lost.
>>
>> Conclusion: "transacted" is currently useless if CXF is used with InOnly
>> Suggestions: Mark the route as InOut => did not help
>>
>> Attached is a small maven project that illustrates the problem with
>> unittests.
>>
>> One solution would of course be to handle ALL route errors with a
>> Camel error handler, but this is more of a workaround. I am wondering
>> if there is a real solution for this problem.
>>
>> Thanks
>> Stefan
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
Re: Message loss with transacted CXF consumer
Posted by Daniel Kulp <dk...@apache.org>.
Can you try setting the property:
org.apache.cxf.interceptor.USE_ORIGINAL_THREAD, "true"
on the CXF endpoint and seeing if that helps? That should keep the request
on the original thread and should allow the stack for that to unwind on an
exception.
Dan
On Wednesday, May 02, 2012 04:36:35 PM Stefan Burkard wrote:
> Hi
>
> The facts:
> - InOnly route
> - CXF bean consumes with "transacted" from JMS queue
> => therefore I expect the message to succeed or to go to JMS-DLQ
>
> Result: CXF consumer commits JMS message in any case - no matter if
> exceptions occur in route. If an error occurs during route processing
> the message is lost.
>
> Conclusion: "transacted" is currently useless if CXF is used with InOnly
> Suggestions: Mark the route as InOut => did not help
>
> Attached is a small maven project that illustrates the problem with
> unittests.
>
> One solution would of course be to handle ALL route errors with a
> Camel error handler, but this is more of a workaround. I am wondering
> if there is a real solution for this problem.
>
> Thanks
> Stefan
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com