Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-1550 Authorizer API
  3. NIFI-1860

Backward compatibility for Site-to-Site client

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0, 1.0.0-Beta
    • Core Framework
    • None

    Description

      NIFI-1554 has moved /nifi-api/controller to /nifi-api/site-to-site/ .
      However, Site-to-Site client is not updated yet, and it still sends a request to /nifi-api/controller to obtain information for Site-to-Site.

      EndpointConnectionPool.java
          private ControllerDTO refreshRemoteInfo() throws IOException {
              final boolean webInterfaceSecure = clusterUrl.toString().startsWith("https");
              final NiFiRestApiUtil utils = new NiFiRestApiUtil(webInterfaceSecure ? sslContext : null);
              final ControllerDTO controller = utils.getController(apiUri + "/controller", commsTimeout);
      

      We can simply change the URL to "/site-to-site", but if we do so, old version of NiFi won't be able to communicate with the new version of NiFi via Site-to-Site.
      Possible approaches to provide backward compatibility are:

      Similarly when new version of NiFi tries to communicate with old version of NiFi, it has to send request to /controller, instead of /site-to-site. For this scenario, adding retry logic in new version of SIte-to-SIte client would be sufficient.

      1. Send request to /site-to-site
      2. If response code is 404 or 405, then retry sending request to /controller

      Attachments

        Activity

          People

            ijokarumawak Koji Kawamura
            ijokarumawak Koji Kawamura
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: