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

ASF GitHub Bot commented on NIFI-2585:
--------------------------------------

Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/1320
  
    @bbende @randerzander 
    
    Thanks for proposing this feature, it'll be useful!
    
    Started reviewing this, and noticed few things.
    
    1. Difference between RAW and HTTP protocol for receiving data.
    
        RAW resolves hostname from socket, while HTTP does so from HTTP 
request. Due to this difference, RAW uses hostname as `s2s.host` attribute like 
`localhost`, while HTTP set `127.0.0.1`. I think this may be difficult when 
users define routing rules in downstream flow. I wonder if it can produce the 
same value, hostname or ip address for both transport protocol.
    
    2. Unknown hostname and port due to illegal URL
    
        As discussed in the [previous 
PR](https://github.com/apache/nifi/pull/1307#issuecomment-266442657),  I got 
'unknown' hostname and port with Docker containers. While this can be handled 
as a corner case since it's not allowed by the URL specification, I think it'd 
be better if we can be lenient here to support Docker environment. I confirmed 
provenance event also failed to resolve hostname and produced provenance 
details with `null` hostname.
    
        I think this can be improved by changing Peer's constructor. It parses 
peerUrl then use its hostname and port, but the same information should be 
retrieved from PeerDescriptor without parsing the URL. Currently, 
SocketRemoteSiteListener uses server's hostname and port for PeerDescription, 
but it seems it's not correct, those should be client's.
    
    Please let me dig deeper comments above. Will update soon.


> Add attributes to track where a flow file came from when receiving over 
> site-to-site
> ------------------------------------------------------------------------------------
>
>                 Key: NIFI-2585
>                 URL: https://issues.apache.org/jira/browse/NIFI-2585
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Bryan Bende
>            Assignee: Randy Gelhausen
>            Priority: Minor
>
> With MiNiFi starting be used to send data to a central NiFi, it would be 
> helpful if information about the sending host and port was added to each flow 
> file received over site-to-site. Currently this information is available and 
> used to generate the transit URI in the RECEIVE event, but this information 
> isn't available to downstream processors that might want to make routing 
> decisions.
> For reference:
> https://github.com/apache/nifi/blob/e23b2356172e128086585fe2c425523c3628d0e7/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/AbstractFlowFileServerProtocol.java#L452
> A possible approach might be to add two attributes to each flow file, 
> something like "remote.host" and "remote.address" where remote.host has only 
> the sending hostname, and remote.address has the sending host and port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to