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 859057718 for ; Fri, 30 Sep 2011 09:04:26 +0000 (UTC) Received: (qmail 83800 invoked by uid 500); 30 Sep 2011 09:04:25 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 83202 invoked by uid 500); 30 Sep 2011 09:04:21 -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 83114 invoked by uid 99); 30 Sep 2011 09:04:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2011 09:04:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bcanhome@googlemail.com designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2011 09:04:12 +0000 Received: by iagf6 with SMTP id f6so2091431iag.32 for ; Fri, 30 Sep 2011 02:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=6ZK4TacJsMJACbzeM87CGPhbGff6O3FeKzuc64x0+QU=; b=CKSygPxlg+CGjk2FEJWzQjILrMzXHL2J08dmIlutuOrnFYtxc/9m5AkFA9xamoKhru iB/CqZuga/RSvvKQ2fMV0EfOqY9wK74+ICmxTYAUgcmjNB90Sc6TcoVNw9KhEpv0mCgJ exupoRU3iiNIB3jClhFJLdMGpJfWvz4/bIgV0= MIME-Version: 1.0 Received: by 10.231.20.207 with SMTP id g15mr17099659ibb.66.1317373431551; Fri, 30 Sep 2011 02:03:51 -0700 (PDT) Received: by 10.231.12.74 with HTTP; Fri, 30 Sep 2011 02:03:51 -0700 (PDT) In-Reply-To: References: Date: Fri, 30 Sep 2011 11:03:51 +0200 Message-ID: Subject: Re: recipientList inside SEDA route with CXF From: Achim Nierbeck To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org The suggested workaround by Jon really does the trick. instead of using the recipientlist inside the spring route: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cxf:bean:productionServer?address=3D${header.address} =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 I used a std. bean which looks like the following: public class WebServiceRecipientListBean { @RecipientList(parallelProcessing=3Dtrue) public String route(@Header("address") String address) { if (address =3D=3D null) return null; return "cxf:bean:productionServer?address=3D"+address; } } This pretty much did the trick. Thanks a lot for the fast help and regards, Achim 2011/9/29 Jon Anstey : > FYI created https://issues.apache.org/jira/browse/CAMEL-4503 for the > recipient list bug and Achim is trying out another approach to workaround > this issue. > > On Thu, Sep 29, 2011 at 11:46 AM, Achim Nierbeck wrote: > >> I did take a look at the sources and I think I found the >> root of my problem, though I'm not sure how to get around it: >> >> RecipientList class contains a producer cache, >> in this cache the RecipientListProcessor class does store the >> endpoints depending on the uri as key. >> Now since only my header changes I don't know how to get around this. >> Any ideas? >> >> Thanks in advance, Achim >> >> 2011/9/29 Achim Nierbeck : >> > Ok, >> > >> > some more worrying details. >> > >> > Right now I have two Remote Hosts >> > After a successful run on Host A a second run is done (not parallel >> > but sequential) on Host B. >> > And I'm able to see that the header.address is set to host B still I >> > see that the request is made on Host A. >> > >> > Is this intentional, are there any ways of not "remembering" which >> > call did go to which Host? >> > >> > Thanks again, Achim >> > >> > 2011/9/29 Achim Nierbeck : >> >> Hi >> >> >> >> using Camel 2.8.0 I'm having the following scenario. >> >> I'm using the CXF for connecting to a couple .NET Webservices. >> >> >> >> =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0> >> >> =A0serviceClass=3D"net.testservices.productionservice._2011_07.IService" >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0endpointName=3D"s:basicHttpProductionS= ervice" >> serviceName=3D"s:ProductionService" >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wsdlURL=3D"classpath:/wsdl/_1.wsdl" xm= lns:s=3D" >> http://tempuri.org/" >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xmlns:a=3D" >> http://schemas.microsoft.com/2003/10/Serialization/Arrays" >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xmlns:i=3D"http://www.w3.org/2001/XMLS= chema-instance"> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 >> >> >> >> >> >> Now I have a route for looking up some data in the DB for example als= o >> >> looking for a free >> >> WebService to call: >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0> uri=3D"timer://pollQueueTimer?fixedRate=3Dtrue&period=3D30000" /> >> >> >> >> ... do preparation .... >> >> ... also set the address of the remote host into the header of the >> exchange ... >> >> ... call the "production" route ... >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0> /> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> the production route does call the Webservice on the available remote >> >> host as follows >> >> >> >> ... again a couple of preparations beforehand .... >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[ ] >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> =A0ProduceData >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> ... the address of the remote webservice was previously added to the >> >> header in the starting route ... >> >> >> >> >> >> ... I needed to set the parallelProcessing to true, if not everything >> >> fails because the Timer Route tries to start another recipientList ..= . >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> =A0cxf:bean:productionServer?address=3D${header.address} >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> ... some more calls checking data, errorhandling =A0and so forth .... >> >> >> >> >> >> Now the following happened to me when I had more than one Remote Host >> >> available: >> >> >> >> Calls to Host A did run on Host B >> >> Results expecting to be retrieved from Host A where polled from Host = B. >> >> Now I wonder if the calls to certain Methods are cached or if the >> >> "re-running" timmer route does >> >> interfere somehow with the already running route. >> >> >> >> A Complete run of a route can take up to about 30 Minutes after that >> >> the "Production"-Route is done. >> >> Since there are multiple hosts available we want to do parallel >> processing. >> >> >> >> Any hints are welcome, >> >> >> >> Achim >> >> >> >> >> >> -- >> >> -- >> >> *Achim Nierbeck* >> >> >> >> >> >> Apache Karaf Committer & PMC >> >> OPS4J Pax Web >> >> Committer & Project Lead >> >> blog >> >> >> > >> > >> > >> > -- >> > -- >> > *Achim Nierbeck* >> > >> > >> > Apache Karaf Committer & PMC >> > OPS4J Pax Web >> > Committer & Project Lead >> > blog >> > >> >> >> >> -- >> -- >> *Achim Nierbeck* >> >> >> Apache Karaf Committer & PMC >> OPS4J Pax Web >> Committer & Project Lead >> blog >> > > > > -- > Cheers, > Jon > --------------- > FuseSource > Email: jon@fusesource.com > Web: fusesource.com > Twitter: jon_anstey > Blog: http://janstey.blogspot.com > Author of Camel in Action: http://manning.com/ibsen > --=20 -- *Achim Nierbeck* Apache Karaf Committer & PMC OPS4J Pax Web Committer & Project Lead blog