Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3DD8B9763 for ; Sun, 26 Feb 2012 08:26:49 +0000 (UTC) Received: (qmail 81954 invoked by uid 500); 26 Feb 2012 08:26:48 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 81885 invoked by uid 500); 26 Feb 2012 08:26:48 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 81866 invoked by uid 99); 26 Feb 2012 08:26:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2012 08:26:48 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.45 as permitted sender) Received: from [209.85.215.45] (HELO mail-lpp01m010-f45.google.com) (209.85.215.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2012 08:26:44 +0000 Received: by lahi5 with SMTP id i5so5495820lah.32 for ; Sun, 26 Feb 2012 00:26:22 -0800 (PST) Received-SPF: pass (google.com: domain of claus.ibsen@gmail.com designates 10.152.45.134 as permitted sender) client-ip=10.152.45.134; Authentication-Results: mr.google.com; spf=pass (google.com: domain of claus.ibsen@gmail.com designates 10.152.45.134 as permitted sender) smtp.mail=claus.ibsen@gmail.com; dkim=pass header.i=claus.ibsen@gmail.com Received: from mr.google.com ([10.152.45.134]) by 10.152.45.134 with SMTP id n6mr7305415lam.45.1330244782668 (num_hops = 1); Sun, 26 Feb 2012 00:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=koXNCrtds/9Lpa0ZhcJgThr4FomsiNThMAmzI1Rw9ao=; b=S98RgQKSW/bkQNS5bR2VcnywMuThoOfzTWYS+LMznb3JeOfZIYeWtgjIV4sGKTlEV/ 5Cg61zAc4gvl7NqHCgrulsyG30mnxDUgsG4+z0UB6hv7NZToNZdjFROMteZWMPB86L8O 8ruI8BBKj7fpiLNpEwRqEfvRi+JBCPrLuW/0A= Received: by 10.152.45.134 with SMTP id n6mr6103942lam.45.1330244782551; Sun, 26 Feb 2012 00:26:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.87.100 with HTTP; Sun, 26 Feb 2012 00:26:02 -0800 (PST) In-Reply-To: <1330114351915-5513828.post@n5.nabble.com> References: <1329895735355-5504378.post@n5.nabble.com> <1330114351915-5513828.post@n5.nabble.com> From: Claus Ibsen Date: Sun, 26 Feb 2012 09:26:02 +0100 Message-ID: Subject: Re: Endpoint exception handling To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Fri, Feb 24, 2012 at 9:12 PM, tkatva wrote: > Hi Claus > > Thank you for your responses... My concern is that I want polling > FTP/FTPS/SFTP/FILE-endpoints to call my custom code if error occurs... Can > you point me to a example where I can see how I can apply this > pollingStrategy to these endpoints ? > > I am constructing endpoints programmatically and creating url's based on > values received from database. Here is part of my code: > > RouteDefinition routeDef = new RouteDefinition(); > > //Endpoint url constructed from values from db > org.apache.camel.Endpoint fromEnd = camel.getEndpoint(fromUrl); > > routeDef.from(fromEnd); > > //Add "to" endpoints which are constructed the same way > routeDef.to(toEndpoints); > > Then route is added to CamelContext and started later. > > If you could show example how I could add pollingStrategy to > "fromEnd"-endpoint, you would save my week or maybe whole month ... :) > You would need to register your custom poll strategy in the registry. If you use Spring XML then its a tag. If you use standalone Java, then you may want to use the SimpleRegistry with CamelContext and add it to this strategy from java code. Then in the endpoint uri, you just refer to the id of your custom poll strategy using #id file:foo?pollStrategy=#myPollStrategy If you use Spring XML then > Thank you > > Best Regards Tuomas Katva > > -- > View this message in context: http://camel.465427.n5.nabble.com/Endpoint-exception-handling-tp5504378p5513828.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- 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/