camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: CXF consumer: fault handling
Date Thu, 05 Aug 2010 09:56:55 GMT
Willem Jiang wrote:
> Willem Jiang wrote:
>> S. Ali Tokmen wrote:
>>> Hello
>>>
>>> On 05/08/2010 05:47, Willem Jiang wrote:
>>>> CXF FaultOutInterceptor will take care of it if you just throw the 
>>>> Fault message out from CxfConsumer.
>>>
>>> Well, let's assume the route is configured like:
>>>
>>>    from("cxf:...")
>>>    .process(new FirstProcessor())
>>>    .process(new SecondProcessor())
>>>    .process(new ThirdProcessor())
>>>
>>> In this case, if the first processor is the one to return the fault, 
>>> and that it only returns a fault, then the second and third processor 
>>> will be executed.
>>>
>>> Whereas, if the processor throws the exception (generated by CXF and 
>>> containing all @WebFault annotations, remember) then the second and 
>>> third processor won't be executed.
>>>
>>> Do you think my use case is wrong?
>>
>> I got it, you don't want to throws the exception in FirstProcessor to 
>> keep the exchange being processed by Second and ThirdProcessor.
>>
>> I just checked the CxfConsumer code of the camel trunk, it will check 
>> the fault message if the exchange is failed.
>>
>> So please just set the exchange to be failed, then CxfConsumer will 
>> throw the exception for your.
> 
> Just have a second thought, we should let CxfConsumer check if the 
> exchange out message is the fault message first, if you set the Exchange 
> to failed, it will trigger the ErrorHandler and the other two processor 
> will not be processed.
> 

I just wrote a test to verify it[1], if you set the fault message, the
Exchange is failed, and the pipeline will route the exchange to next
processor, and we don't need change any of CxfConsumer codes.

[1]http://svn.apache.org/viewvc?rev=982524&view=rev
>>
>> Willem
>> ----------------------------------
>> Apache Camel, Apache CXF committer
>> Open Source Integration http://www.fusesource.com
>> Blog http://willemjiang.blogspot.com
>> Tiwtter http://twitter.com/willemjiang
>>>
>>> Cheers
>>>
>>> S. Ali Tokmen
>>> savas-ali.tokmen@bull.net
>>>
>>> Office: +33 4 76 29 76 19
>>> GSM:    +33 66 43 00 555
>>>
>>> Bull, Architect of an Open World TM
>>> http://www.bull.com
>>>
>>>
>>
>>
> 
> 



Mime
View raw message