Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5627F200D6F for ; Mon, 27 Nov 2017 01:48:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 54B2A160BFF; Mon, 27 Nov 2017 00:48:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9D17A160C13 for ; Mon, 27 Nov 2017 01:48:04 +0100 (CET) Received: (qmail 23108 invoked by uid 500); 27 Nov 2017 00:48:03 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 22958 invoked by uid 99); 27 Nov 2017 00:48:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2017 00:48:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9BFEC1A1101 for ; Mon, 27 Nov 2017 00:48:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id i4Wcn1sKllTV for ; Mon, 27 Nov 2017 00:48:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 02F035F19B for ; Mon, 27 Nov 2017 00:48:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 736E7E09A5 for ; Mon, 27 Nov 2017 00:48:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 33DD5241A6 for ; Mon, 27 Nov 2017 00:48:00 +0000 (UTC) Date: Mon, 27 Nov 2017 00:48:00 +0000 (UTC) From: "Ioannis Sermetziadis (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CAMEL-11792) New ftp connection for each file transfer with tempFileName option in URI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Nov 2017 00:48:05 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16266276#comment-16266276 ] Ioannis Sermetziadis edited comment on CAMEL-11792 at 11/27/17 12:47 AM: ------------------------------------------------------------------------- Hello! I spent some time on this issue. I searched a bit how Camel creates new endpoints and when running the example code, it does not create multiple endpoints. So IMHO a single endpoint instance that uses a single FTP client instance is used for all ftp calls. So I ended up checking the Apache FTP client on which the camel-ftp component depends. The library seems to intentionally open two (control & data) connections for each FTP command, while a Camel endpoint might require one or more FTP command to complete. So, to me, it is clear that this is a limitation of the library. Maybe this could be made possible by implementing a wrapper SocketFactory and ServerSocketFactory that would reuse the connections instead of closing them. But this seems more like a work-around. Maybe other FTP client implementations do not have this limitation. On the other side, I am wondering if such an approach of unifying all the FTP connections into one connection, is a good idea. This will probably affect the throughput because all the socket reads and writes will need to be serialized (socket not thread-safe). Or maybe this is a limitation of the FTP protocol itself. What do you think? I would volunteer to work on an agreed solution/fix/work-around. was (Author: sermojohn): Hello! I spent some time on this issue. I searched a bit how Camel creates new endpoints and when running the example code, it does not create multiple endpoints. So IMHO a single endpoint instance that uses a single FTP client instance is used for all ftp calls. So I ended up checking the Apache FTP client on which the camel-ftp component depends. The library seems to intentionally open two (for command & data) connections for each FTP command, while a Camel endpoint might require one or more FTP command to complete. So, to me, it is clear that this is a limitation of the library. Maybe this could be made possible by implementing a wrapper SocketFactory and ServerSocketFactory that would reuse the connections instead of closing them. But this seems more like a work-around. Maybe other FTP client implementations do not have this limitation. On the other side, I am wondering if such an approach of unifying all the FTP connections into one connection, is a good idea. This will probably affect the throughput because all the socket reads and writes will need to be serialized (socket not thread-safe). Or maybe this is a limitation of the FTP protocol itself. What do you think? I would volunteer to work on an agreed solution/fix/work-around. > New ftp connection for each file transfer with tempFileName option in URI > ------------------------------------------------------------------------- > > Key: CAMEL-11792 > URL: https://issues.apache.org/jira/browse/CAMEL-11792 > Project: Camel > Issue Type: Bug > Components: camel-ftp > Affects Versions: 2.19.2 > Reporter: Himanshu Mittal > Priority: Minor > Attachments: TestFTPConnection.java > > > When we have {{tempFilename}} in camel uri and we use producer template to write file to remote ftp location , camel opens new connection for every file transfer. Though disconnect option is set to false in uri. > If we take out tempFilename from uri connections are reused > We can verify it by running attached sample. > Check the connections made from camel server to ftp server . Fire {{netstat -an|grep 10.80.14.56|wc -l]] > - When we have tempFileName in uri it will show 1 connection per file transfer > - Without tempFileName it will show only 1 connection for all files transfer. -- This message was sent by Atlassian JIRA (v6.4.14#64029)