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 EBA1290D5 for ; Tue, 14 May 2013 14:08:15 +0000 (UTC) Received: (qmail 77957 invoked by uid 500); 14 May 2013 14:06:41 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 76211 invoked by uid 500); 14 May 2013 14:06:29 -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 72292 invoked by uid 99); 14 May 2013 14:03:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 May 2013 14:03:29 +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 (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.220.43 as permitted sender) Received: from [209.85.220.43] (HELO mail-pa0-f43.google.com) (209.85.220.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 May 2013 14:03:23 +0000 Received: by mail-pa0-f43.google.com with SMTP id hz10so552834pad.2 for ; Tue, 14 May 2013 07:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:message-id:in-reply-to:references:subject :x-mailer:mime-version:content-type:content-transfer-encoding :content-disposition; bh=Ch2Sv33l7weX98lfq8dudkPEgSXm3wcMO4yMgeystAw=; b=l0RIleT+UI2nlsB+isArh55tunZVmQ9WVUtnt6lG9GRqrOyBn5LQXUC4u2CipLFw7Z y3HG3Ae0UdpWd13IfHuK06q3lPpz0+Hr1w94++0S0RoeaqE+Rsr/jOvX+z1fLdx50DCa 34+wMqwjkb83nMI5f7rITmwBvZ5XgOb4EuxNr59Pu5k/q3JyhPdRZV5j1iEybnSwDqUn gmH8fvpTYZUQVTrO8Yvs9Je7hCM4aPspxZSn1azFINbBe5IQWSGSoBGlaENF1NMg6zPa WDeD23c0g3nei1TMdW5Ukt3mWclH1J9KcBp2ZtwRIOpYLKj/yAyIJE7NaRsTmyz0+pQb V9+w== X-Received: by 10.66.158.36 with SMTP id wr4mr34468764pab.28.1368540182598; Tue, 14 May 2013 07:03:02 -0700 (PDT) Received: from [192.168.1.135] ([125.34.4.111]) by mx.google.com with ESMTPSA id fr1sm7873821pbb.26.2013.05.14.07.03.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 May 2013 07:03:01 -0700 (PDT) Date: Tue, 14 May 2013 22:02:56 +0800 From: Willem jiang To: users@camel.apache.org Message-ID: <00354B55D5E448378CE93C50E2DB90A5@gmail.com> In-Reply-To: <1368521185175-5732474.post@n5.nabble.com> References: <1368445123795-5732401.post@n5.nabble.com> <1368521185175-5732474.post@n5.nabble.com> Subject: Re: Streaming a PDF from remote machine X-Mailer: sparrow 1.6.4 (build 1176) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org I'm afraid you have to implement the timeout mechanism yourself. I don't aware camel provides this feature out of box. BTW, I think the solution2 that you have is a good one. =20 -- =20 Willem Jiang Red Hat, Inc. =46useSource is now part of Red Hat Web: http://www.fusesource.com =7C http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) = (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On Tuesday, May 14, 2013 at 4:46 PM, Chinababu Illa wrote: > Thanks Willem. > =20 > A bit more details on the problem. > =20 > There are 3 applications involved in this issue. =46rontEnd, Link and H= ost. > Link sits between =46rontEnd and Host. When =46rontEnd sends a request = (http > post) to Link it in turn sends a request to Host and also creates two > streams one to read from Host and other one to send the same data to > =46rontEnd. Due to slow streaming from Host, the =46rontEnd to download= the file > is taking longer time. And we cannot afford user waiting for that longe= r. > So, want to terminate downloading after certain period of time. > =20 > Please find details below for your points. > =20 > *Are you using =46TP to download the file=3F* > - /No./ > =20 > *I'm not sure how the BufferedInputStream is involved. * > - /=46rontEnd reads response as Stream (InputStream) is how > BufferedInputStream involved here. > We are wrapping InputStream with BufferedInputStream./ > =20 > *If the file is downloaded, the BufferedInputStream will never time out= .* > - /Consider a case where file is still downloading and read never gets > timedout as it is getting data (a less data) for every read/ > =20 > *If the BufferedInputStream has the timeout mechanism, I don't think yo= u > need to check if the =46ile is download.* > - /BufferedInputStream has the timeout mechanism but it will never time= out > as it gets data within timeout period./ > =20 > =20 > I have already got two solutions with me. > =20 > 1) Implementing timeout manually (not a good idea, not elegant solution= ) > 2) Create a message listener send a message to start downloading, send = a > message to terminate downloading after certain time. > 3) Looking if Camel can solve this by auto imposing timeout. > =20 > So, please let me know if Camel has a solution for this kind of problem= s. If > so, point me what to look into. > =20 > Thanks, > Chinna > =20 > =20 > =20 > =20 > =20 > -- > View this message in context: http://camel.465427.n5.nabble.com/Streami= ng-a-PD=46-from-remote-machine-tp5732401p5732474.html > Sent from the Camel - Users mailing list archive at Nabble.com (http://= Nabble.com).