Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5521

Provide "clusterNodeName()" function in Expression Language

    XMLWordPrintableJSON

Details

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            alopresto Andy LoPresto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: