camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Error handling with recipientList
Date Fri, 06 Nov 2009 12:21:34 GMT
On Fri, Nov 6, 2009 at 1:00 PM, mcrive <mcrive@optasportsdata.com> wrote:
>
> Is this FTP component issue a bug? Do you think there is a chance to have a
> fix in Camel 2.0?
> thank you very much for the support!
>

No we wont do a special 2.0 patched release. The next one is 2.1 which
hopefully should get started soon when Hadrian returns from ApacheCon
US.

There are other solutions to this in pure 2.0 that you have to use instead.

You could add a header to the message that contains all the endpoints
in the receipient list then you at least have them all.
And then you can maybe compute which one failed in your custom error
handler processor.



> Claus Ibsen-2 wrote:
>>
>> On Fri, Nov 6, 2009 at 10:02 AM, mcrive <mcrive@optasportsdata.com> wrote:
>>>
>>> Isn't the trunk where you commit the one containing changes after 2.0
>>> REL?
>>> I am facing the issue with 2.0, everything is fine with 2.1.
>>>
>>
>> Yeah it was against trunk.
>>
>> Instead of using intercept to endpoint you could use your own kind of
>> recipient list using a regular processor where you set the header
>> before sending to that endpoint.
>>
>> So instead of .recipientList(xxx) you can use a .process(new
>> MyRecipientListProcessor(xxx));
>>
>>
>>>
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> On Thu, Nov 5, 2009 at 4:09 PM, mcrive <mcrive@optasportsdata.com>
>>>> wrote:
>>>>>
>>>>> doing the same thing with Camel 2.1 I can see what I am expecting
>>>>> so it is definetly something with FTP component...
>>>>> seems it is not keeping headers that are set on interceptSendToEndpoint
>>>>>
>>>>>
>>>>
>>>> Hi
>>>>
>>>> I just added a FTP unit test that uses recipient list and error
>>>> handling. And it works for me.
>>>> http://svn.apache.org/viewvc?rev=833105&view=rev
>>>>
>>>>
>>>>>
>>>>> mcrive wrote:
>>>>>>
>>>>>>
>>>>>> I think the issue is in the FTP component,
>>>>>> by using following context
>>>>>>
>>>>>> context.addRoutes(new RouteBuilder() {
>>>>>>
>>>>>>       public void configure() {
>>>>>>
>>>>>>               onException(Exception.class)
>>>>>>                               .handled(true)
>>>>>>
>>>>>> .to("log:org.apache.camel.example?showHeaders=true&showCaughtException=true");
>>>>>>
>>>>>>               interceptSendToEndpoint("(ftp|direct):.*").process(new
>>>>>> Processor() {
>>>>>>                               public void process(Exchange
exchange)
>>>>>> throws Exception {
>>>>>>                                            
  String target =
>>>>>> exchange.getIn().getHeader(Exchange.INTERCEPTED_ENDPOINT,
>>>>>> String.class);
>>>>>>
>>>>>> exchange.getIn().setHeader("target", target);
>>>>>>
>>>>>> System.out.println("target:" + target);
>>>>>>                               }
>>>>>>               });
>>>>>>
>>>>>>               from("direct:start").recipientList(header("foo"));
>>>>>>               from("direct:kabom").throwException(new
>>>>>> IllegalArgumentException("Damn"));
>>>>>>
>>>>>>       }
>>>>>> });
>>>>>>
>>>>>> context.start();
>>>>>>
>>>>>> String foo =
>>>>>> "direct:foo,direct:kabom,ftp://notexist@ftp.unknown.com?password=what&tempPrefix=tmp&fileName=cif-prototype/feed.xml";
>>>>>> template.sendBodyAndHeader("direct:start", "Hello World", "foo",
foo);
>>>>>>
>>>>>>
>>>>>> the log shows me target=direct://kabom for the error raised on
>>>>>> direct:kabom enpoint
>>>>>> it shows me target=direct://start for the error raised on the ftp
>>>>>> endpoint.
>>>>>> that's the issue I am facing, I am not able to see target=ftp://...
>>>>>> when
>>>>>> catching the exception on the FTP endpoint, looks like the header
is
>>>>>> not
>>>>>> propagated to the FTP component.
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Error-handling-with-recipientList-tp26196454p26215744.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Error-handling-with-recipientList-tp26196454p26228650.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Error-handling-with-recipientList-tp26196454p26230486.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message