Andy LoPresto created NIFI-5521:
-----------------------------------

             Summary: Provide "clusterNodeName()" function in Expression 
Language
                 Key: NIFI-5521
                 URL: https://issues.apache.org/jira/browse/NIFI-5521
             Project: Apache NiFi
          Issue Type: New Feature
          Components: Extensions
    Affects Versions: 1.7.1
            Reporter: Andy LoPresto


I find during debugging that it would be helpful to see which node of a cluster 
processed a specific flowfile. This data is available in the provenance 
records, but is not available to the flowfile during processing. I propose a 
new EL function {{clusterNodeName()}} which would return the configured value 
of {{nifi.web.https.host}} or {{nifi.web.http.host}}. This may need to include 
the {{nifi.web.http(s).port}} value to differentiate if multiple instances are 
being run on the same node. 

The current EL functions of {{ip()}}, {{hostname(true)}}, and 
{{hostname(false)}} do not adequately perform this function because the 
hostname resolver would not be unique when multiple instances are run on the 
same machine. 

Scenario:
{{node1.nifi.apache.org}} running on localhost with port {{9443}}
{{node2.nifi.apache.org}} running on localhost with port {{9444}}
*dnsmasq* settings to resolve {{*.nifi.apache.org}} to {{127.0.0.1}}
Local machine hostname: {{my-dns-name.local}}
Local machine IP: {{192.168.0.28}}

||Function||Value on Node 1||Value on Node 2||
|{{ip()}}|192.168.0.28|192.168.0.28|
|{{hostname(true)}}|192.168.0.28|192.168.0.28|
|{{hostname(false)}}|my-dns-name.local|my-dns-name.local|
|{{clusterNodeName()}}|**node1.nifi.apache.org**|**node2.nifi.apache.org**|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to