[ 
https://issues.apache.org/jira/browse/NIFI-3931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16072453#comment-16072453
 ] 

Pierre Villard commented on NIFI-3931:
--------------------------------------

You're right [~joewitt], that something to look into. After a quick glance I 
see, both in FTP and SFTP processors, the following logic:

=> SFTP processors
{code}
        if (sftp != null) {
            String sessionhost = session.getHost();
            String desthost = 
ctx.getProperty(HOSTNAME).evaluateAttributeExpressions(flowFile).getValue();
            if (sessionhost.equals(desthost)) {
                // destination matches so we can keep our current session
                return sftp;
            } else {
                // this flowFile is going to a different destination, reset 
session
                close();
            }
        }
{code}

=> FTP processors
{code}
        if (client != null) {
            String desthost = 
ctx.getProperty(HOSTNAME).evaluateAttributeExpressions(flowFile).getValue();
            if (remoteHostName.equals(desthost)) {
                // destination matches so we can keep our current session
                resetWorkingDirectory();
                return client;
            } else {
                // this flowFile is going to a different destination, reset 
session
                close();
            }
        }
{code}

But in case we are using multiple threads, we probably face some issues. Will 
try to run some tests.
And in terms of performances, re-creating a client for, potentially, each flow 
file, is not great.
That could certainly be improved with some kind of clients pool.

> putSftp process port property should support for expression language
> --------------------------------------------------------------------
>
>                 Key: NIFI-3931
>                 URL: https://issues.apache.org/jira/browse/NIFI-3931
>             Project: Apache NiFi
>          Issue Type: Improvement
>    Affects Versions: 1.2.0
>            Reporter: Cheng Chin Tat
>            Assignee: Pierre Villard
>            Priority: Minor
>              Labels: easyfix
>
> PutSftp Processor port property should support for expression language so 
> that dynamic port number can be pass to the processor during run time. 
> Rather than preset the port on design time.
> This changes involve changing the PropertyDescriptor SFTP_PORT validator 
> StandardValidators.NON_NEGATIVE_INTEGER_VALIDATOR to 
> StandardValidators.NON_EMPTY_VALIDATOR and other codes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to