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 32DE57612 for ; Fri, 9 Dec 2011 08:01:54 +0000 (UTC) Received: (qmail 47910 invoked by uid 500); 9 Dec 2011 08:01:53 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 47869 invoked by uid 500); 9 Dec 2011 08:01:53 -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 47861 invoked by uid 99); 9 Dec 2011 08:01:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2011 08:01:52 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of freeman.fang@gmail.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, 09 Dec 2011 08:01:45 +0000 Received: by iadk27 with SMTP id k27so319805iad.32 for ; Fri, 09 Dec 2011 00:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; bh=/5iIlaab4OintI/sCA+K9tz6rVhC9j9JIeZYlyZqMVk=; b=h6UZI8asWTCOFaugfYuG/z/Xg1PESSIW+ZK3wdlEXYLgl+IY0ql9hxwI/a2hqUmNrQ Pka2lsf3XQ2mQ4D4wokiax6SrGiWjFGoUqg70kD/QOCV3WkDPB7iximbjoVfeag37R5q XaAlEUBlGAXsDZSxgO4a50m4CUFOT66fIMNqQ= Received: by 10.50.214.2 with SMTP id nw2mr2383687igc.54.1323417684744; Fri, 09 Dec 2011 00:01:24 -0800 (PST) Received: from [192.168.1.101] ([123.119.241.57]) by mx.google.com with ESMTPS id wn1sm15962192igc.3.2011.12.09.00.01.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Dec 2011 00:01:22 -0800 (PST) Message-Id: <2E4EB762-6BCE-4CDE-BBED-6F3EA9D6A62E@gmail.com> From: Freeman Fang To: users@camel.apache.org In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-1--634399340 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: using camel to call multiple web services asynchronously Date: Fri, 9 Dec 2011 16:01:07 +0800 References: <1323357765249-5059120.post@n5.nabble.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-1--634399340 Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Or for using cxf, you can also use JAX-WS asynchronous invocation =20 model directly, which allows the client thread to continue after making a two-way invocation without being blocked while awaiting a response from the server, you can check jaxws_async example shipped =20 with cxf kit to get more details. Freeman On 2011-12-9, at =E4=B8=8B=E5=8D=8812:51, Claus Ibsen wrote: > On Thu, Dec 8, 2011 at 4:22 PM, fachhoch wrote: >> I call a webservice for my application for a user action, I have =20 >> spring,cxf >> client , I use this client to call the webservice, now our =20 >> requirement added >> new webservice call , so I have to call two webservices , the old =20 >> one and >> the new one, my initial plan is in a method I will call each =20 >> webservice, >> club the result return the result, this will take more time as I =20 >> have to >> wait for first webservice to return result then call second =20 >> webservice >> , other way is to call each webservice in a thread asynchronously =20= >> this way >> both webservices are called at the same time , an overall time is >> reduced,does camel has anything inbuilt for calling multiple =20 >> webservices >> asynchronously ? >> > > The ProducerTemplate have API for invoking async with either a Future > as return value, or a callback. > Then you can use that API from a Java bean and invoke the 2 web > services async, and assemble the replies using the Java API. > > Some details here > http://camel.apache.org/async > > As well the JavaDoc of the ProducerTemplate > > >> >> -- >> View this message in context: = http://camel.465427.n5.nabble.com/using-camel-to-call-multiple-web-service= s-asynchronously-tp5059120p5059120.html >> Sent from the Camel - Users mailing list archive at Nabble.com. > > > > --=20 > 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/ --------------------------------------------- Freeman Fang FuseSource Email:ffang@fusesource.com Web: fusesource.com Twitter: freemanfang Blog: http://freemanfang.blogspot.com --Apple-Mail-1--634399340--