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

Mark Payne commented on NIFI-5521:
----------------------------------

[~alopresto] I am not necessarily opposed to this, but I am not sure that I 
understand the context in which you want the cluster node name... Is it when 
you do a "List Queue" on a connection and look at the data there? If you were 
talking about a remote debugger being attached, then you'd know which node 
you're connected to by the knowing which node your debugger attached to....

Given that you're suggesting to add it to EL I'm guessing the idea there would 
be that you want to use UpdateAttribute to add this as a FlowFile Attribute? 
One concern that I have here is that with the new Load-Balanced connection work 
that is being done, if the flow moves the FlowFile to another node, having such 
an attribute would probably be confusing enough to do more harm than good.

While I'm not opposed to adding such a function, I would like to understand the 
use case better before i say that it's a good idea :)

> 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
>            Priority: Major
>              Labels: cluster, expression-language, identity, node
>
> 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