Skip to content

Commit

Permalink
fix(*): Pass OkHttpMetricsInterceptorProperties to OkHttpMetricsInter…
Browse files Browse the repository at this point in the history
…ceptor constructor (#5102)

- OkHttpMetricsInterceptor constructor changed in a kork bump - this makes things work
  • Loading branch information
jonsie committed Nov 16, 2020
1 parent 0af2a3f commit 00c2680
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ class EurekaProviderConfiguration {
return properties
}

private OkHttpClientConfiguration eurekaOkHttpClientConfig() {
new OkHttpClientConfiguration(eurekaClientConfig(), new OkHttpMetricsInterceptor({ registry }, true))
}

private static Converter eurekaConverter() {
new JacksonConverter(new ObjectMapper()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
Expand All @@ -88,8 +84,10 @@ class EurekaProviderConfiguration {
.enable(MapperFeature.AUTO_DETECT_CREATORS))
}

private EurekaApiFactory eurekaApiFactory() {
new EurekaApiFactory(eurekaConverter(), eurekaOkHttpClientConfig())
private EurekaApiFactory eurekaApiFactory(OkHttpMetricsInterceptorProperties okHttpMetricsInterceptorProperties) {
OkHttpClientConfiguration config = new OkHttpClientConfiguration(eurekaClientConfig(),
new OkHttpMetricsInterceptor({ registry }, okHttpMetricsInterceptorProperties))
return new EurekaApiFactory(eurekaConverter(), config)
}

@Value('${eureka.poll-interval-millis:15000}')
Expand All @@ -100,10 +98,11 @@ class EurekaProviderConfiguration {

@Bean
EurekaCachingProvider eurekaCachingProvider(EurekaAccountConfigurationProperties eurekaAccountConfigurationProperties,
OkHttpMetricsInterceptorProperties okHttpMetricsInterceptorProperties,
List<EurekaAwareProvider> eurekaAwareProviderList,
ObjectMapper objectMapper) {
List<EurekaCachingAgent> agents = []
def eurekaApiFactory = eurekaApiFactory()
def eurekaApiFactory = eurekaApiFactory(okHttpMetricsInterceptorProperties)
eurekaAccountConfigurationProperties.accounts.each { EurekaAccountConfigurationProperties.EurekaAccount accountConfig ->
accountConfig.regions.each { region ->
String eurekaHost = accountConfig.readOnlyUrl.replaceAll(Pattern.quote('{{region}}'), region)
Expand Down

0 comments on commit 00c2680

Please sign in to comment.