Commit e13d9e6b authored by Muskan Srivastava's avatar Muskan Srivastava
Browse files

resolved comments

parent a08844fc
Pipeline #44416 failed with stage
in 9 seconds
......@@ -16,14 +16,16 @@ package org.opengroup.osdu.azure.di;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* Configuration bean for setting up retry and timeouts variables.
*/
@Data
@Component
@ConfigurationProperties(prefix = "azure.service.retry.config")
public class RetryAndTimeoutsConfiguration {
public class HttpConfiguration {
private int maxRetry = 3;
private int connectTimeout = 60000;
......
......@@ -14,21 +14,22 @@
package org.opengroup.osdu.azure.entitlements;
import lombok.Data;
import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* Creates bean of EntitlementsAPIConfig
*/
@Data
@Component
@ConfigurationProperties
public class EntilementsAPIConfigBean extends AbstractFactoryBean<EntitlementsAPIConfig> {
@Value("${AUTHORIZE_API}")
private String AUTHORIZE_API;
@Value("${AUTHORIZE_API_KEY:}")
private String AUTHORIZE_API_KEY;
/**
......
......@@ -15,7 +15,7 @@
package org.opengroup.osdu.azure.httpconfig;
import org.apache.http.client.config.RequestConfig;
import org.opengroup.osdu.azure.di.RetryAndTimeoutsConfiguration;
import org.opengroup.osdu.azure.di.HttpConfiguration;
import org.opengroup.osdu.core.common.http.HttpClientHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
......@@ -28,13 +28,14 @@ import org.springframework.stereotype.Component;
@Component
public class HttpClientHandlerAzure extends HttpClientHandler {
@Autowired
private RetryAndTimeoutsConfiguration configuration;
private HttpConfiguration configuration;
/**
* Constructor to set request and timeout configuration of HttpClientHandler.
*/
public HttpClientHandlerAzure() {
@Autowired
public HttpClientHandlerAzure(HttpConfiguration configuration) {
this.configuration = configuration;
super.REQUEST_CONFIG = RequestConfig.custom()
.setConnectTimeout(configuration.getConnectTimeout())
.setConnectionRequestTimeout(configuration.getRequestTimeout())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment