aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-04-06 11:41:09 +0200
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-04-08 14:14:15 +0200
commitabe4681722ff1fa897454e5bc1703ef446201a78 (patch)
tree31a46b87a2dafbe81f06a50ca4fe2aeec0526211 /src/main
parent6796dc92c4fa0b117abb37261986381a5869a6e9 (diff)
http proxy settings need a different connector
ApacheConnectorProvider supports the http proxy properties defined by DMAAP MR and not the default HttpUrlConnectorProvider Issue-ID: DMAAP-1548 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: Ie1cff823ff247133c69434110b04b8191b46a1f6 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/dmaap/mr/client/impl/DmaapClientUtil.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/org/onap/dmaap/mr/client/impl/DmaapClientUtil.java b/src/main/java/org/onap/dmaap/mr/client/impl/DmaapClientUtil.java
index 4c50596..948ca31 100644
--- a/src/main/java/org/onap/dmaap/mr/client/impl/DmaapClientUtil.java
+++ b/src/main/java/org/onap/dmaap/mr/client/impl/DmaapClientUtil.java
@@ -8,7 +8,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,18 +17,17 @@
* ============LICENSE_END=========================================================
*
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
- *
+ *
*******************************************************************************/
package org.onap.dmaap.mr.client.impl;
import java.util.Properties;
-
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
-
+import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
@@ -55,6 +54,10 @@ public class DmaapClientUtil {
config.property(httpClientProperties[i], properties.getProperty(httpClientProperties[i]));
}
}
+ if ((properties.getProperty(ClientProperties.PROXY_URI) != null) &&
+ !(properties.getProperty(ClientProperties.PROXY_URI).isEmpty())) {
+ config.connectorProvider(new ApacheConnectorProvider());
+ } // else the default connectorProvider (HttpConnectorProvider) will be used
}