Uploaded image for project: 'Data Movement as a Platform'
  1. Data Movement as a Platform
  2. DMAAP-1548

[MR] Cannot connect to DMAAP MR via http proxy using dmaapClient library

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Istanbul Release
    • Honolulu Release

      dmaapClient library supports http proxy properties - ClientProperties.PROXY_USERNAME (jersey.config.client.proxy.username), ClientProperties.PROXY_PASSWORD (jersey.config.client.proxy.password), ClientProperties.PROXY_URI (jersey.config.client.proxy.uri). These properties (if set) along with other properties are passed to the ClientBuilder (javax.ws.rs.client.ClientBuilder) to create a new client instance. However, the proxy properties mentioned above are not used by the javax.ws.rs library as no connectorProvider is specified in the dmaapClient library resulting in the default connectorProvider (HttpUrlConnectorProvider) to be used and the default connectorProvider does not understand the jersey proxy properties. Please see -

      1. https://eclipse-ee4j.github.io/jersey.github.io/apidocs/latest/jersey/index.html?org/glassfish/jersey/client/HttpUrlConnectorProvider.html
      2. https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html#Proxies

      dmaapClient library should support a connectorProvider like ApacheConnectorProvider - https://eclipse-ee4j.github.io/jersey.github.io/apidocs/2.29.1/jersey/org/glassfish/jersey/apache/connector/ApacheConnectorProvider.html that understands the proxy properties specified in the DmapClientUtil.java class.

      Following change was introduced in the setHttpClientProperties method of DmaapClientUtil class to test access to DMAAP MR via a http proxy -

      if ((properties.getProperty(ClientProperties.PROXY_URI) != null) &&
      		        !(properties.getProperty(ClientProperties.PROXY_URI).isEmpty())) {
          config.connectorProvider(new ApacheConnectorProvider());
      }

      On introducing the above change, SDNR was able to access DMAAP MR via the http proxy.

      demskeq8  highstreetherbert , FYI...

            pendurty Ravi Pendurty
            pendurty Ravi Pendurty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: