Spring-boot: Handle StepRegistry connect/read timeout deprecation

Created on 16 Oct 2018  路  6Comments  路  Source: spring-projects/spring-boot

The read-timeout and connect-timout of StepRegistry is deprecated in favour of configuring the client yourself.

Any registry that is a StepRegistry is affected. We expose two related properties for each implementation. We should figure out what we want to do with this.

superseded task

Most helpful comment

We've decided to remove the mappings in the config adapters.

All 6 comments

IMO, we have two choices here:

  • Either we call the deprecated mapping method to the config object and those two properties should be deprecated
  • Or, we don't call that mapping any longer and we do whatever is the recommendation in the auto-config

@wilkinsona and I discussed this yesterday. There is another option, and that is to explicitly declare that you intend to use the HttpUrlConnectionClient when building step-based registries in Spring Boot, and set the properties on the constructor there.

DatadogMeterRegistry.builder(config)
    .httpClient(new HttpUrlConnectionClient(connectTimeout, readTimeout))
    .build();

The properties are not deprecated in this context, because it is clear that connect and read timeout mean what HUC means by connect and read timeout.

Thanks Jon, Andy told me about that discussion and I believe that this is the same thing as the second option in my previous comment.

I'm not sure that we can stop performing the mapping in 2.1 as it will be a breaking change for anyone who is using the auto-configured 鈥ropertiesConfigAdapter 鈥onfig implementation to retrieve the connect or read timeout.

We've decided to remove the mappings in the config adapters.

Closing in favour of #14886.

Was this page helpful?
0 / 5 - 0 ratings