diff --git a/src/main/java/no/nav/veilarboppfolging/client/digdir_krr/DigdirClientImpl.java b/src/main/java/no/nav/veilarboppfolging/client/digdir_krr/DigdirClientImpl.java index 2426c9bbf..280441177 100644 --- a/src/main/java/no/nav/veilarboppfolging/client/digdir_krr/DigdirClientImpl.java +++ b/src/main/java/no/nav/veilarboppfolging/client/digdir_krr/DigdirClientImpl.java @@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j; import no.nav.common.health.HealthCheckResult; import no.nav.common.health.HealthCheckUtils; +import no.nav.common.rest.client.LogRequestInterceptor; import no.nav.common.rest.client.RestClient; import no.nav.common.rest.client.RestUtils; import no.nav.common.types.identer.Fnr; @@ -15,6 +16,7 @@ import org.springframework.cache.annotation.Cacheable; import java.util.Optional; +import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import static java.util.Optional.empty; @@ -41,7 +43,13 @@ public DigdirClientImpl(String digdirUrl, Supplier systemUserTokenProvid this.systemUserTokenProvider = systemUserTokenProvider; this.userTokenProvider = userTokenProvider; this.authService = authService; - this.client = RestClient.baseClient(); + this.client = new OkHttpClient.Builder() + .addInterceptor(new LogRequestInterceptor()) + .connectTimeout(1, TimeUnit.SECONDS) + .readTimeout(5, TimeUnit.SECONDS) + .writeTimeout(5, TimeUnit.SECONDS) + .followRedirects(false) + .build(); } @Cacheable(CacheConfig.DIGDIR_KONTAKTINFO_CACHE_NAME)