URL Aliasing

A versioned item may contain the URL of a registry instance embedded in the content of the item. For example, flows with nested versioning contain the URL of the registry where the nested versioned flow is located. If the location of the registry instances changes, then the content is no longer accurate.

URL aliasing can be used to dynamically handle this situation so that URLs are never written to the stored content, and can be re-written with the correct value when being retrieved by a client.

The aliases are configured in an XML file which can be specified in nifi-registry.properties.

Example aliases in registry-aliases.xml

<aliases>
    <alias>
        <internal>NIFI_REGISTRY_1</internal>
        <external>http://registry1.nifi.apache.org:18080</external>
    </alias>
    <alias>
        <internal>NIFI_REGISTRY_2</internal>
        <external>http://registry2.nifi.apache.org:18080</external>
    </alias>
</aliases>

If a flow is saved to registry with two child process groups, each under version control, the incoming flow would contain something like the following:


"processGroups" : [ {
      ...
      "versionedFlowCoordinates" : {
        "bucketId" : "ca20e058-f6e7-404c-aee0-e30833e792c7",
        "flowId" : "178a6657-e1a7-4cce-8f83-4e615e38f57a",
        "registryUrl" : "http://registry1.nifi.apache.org:18080",
        "version" : 1
      },
      {
      ...
      "versionedFlowCoordinates" : {
        "bucketId" : "ca20e058-f6e7-404c-aee0-e30833e792c7",
        "flowId" : "985cb44b-3aec-32be-860f-d2a0f2c72aac",
        "registryUrl" : "http://registry2.nifi.apache.org:18080",
        "version" : 1
      }
]

With the example aliases configuration above, the URLs would be written to the flow persistence provider as the following:


"processGroups" : [ {
      ...
      "versionedFlowCoordinates" : {
        "bucketId" : "ca20e058-f6e7-404c-aee0-e30833e792c7",
        "flowId" : "178a6657-e1a7-4cce-8f83-4e615e38f57a",
        "registryUrl" : "NIFI_REGISTRY_1",
        "version" : 1
      },
      {
      ...
      "versionedFlowCoordinates" : {
        "bucketId" : "ca20e058-f6e7-404c-aee0-e30833e792c7",
        "flowId" : "985cb44b-3aec-32be-860f-d2a0f2c72aac",
        "registryUrl" : "NIFI_REGISTRY_2",
        "version" : 1
      }
]

When this flow is retrieved from any API call, the internal values would be rewritten to the external values.