Package com.helixframework.okhttp
Class OkHttpClientFactory
java.lang.Object
com.helixframework.okhttp.OkHttpClientFactory
Factory for creating default OkHttp clients.
-
Method Summary
Modifier and TypeMethodDescriptionstatic okhttp3.OkHttpClientCreates a default OkHttpClient implementation with aHelixHttpLoggingInterceptor,RetryInterceptor,HelixMetadataInterceptor,RequestIdInterceptor, andDistributedTracingInterceptorpre-configured.static okhttp3.OkHttpClientnewDefaultClient(io.micrometer.core.instrument.MeterRegistry registry) Creates a default OkHttpClient implementation with aHelixHttpLoggingInterceptor,RetryInterceptor,HelixMetadataInterceptor,RequestIdInterceptor, andDistributedTracingInterceptorpre-configured, as well as metrics wired into Micrometer.
-
Method Details
-
newDefaultClient
public static okhttp3.OkHttpClient newDefaultClient()Creates a default OkHttpClient implementation with aHelixHttpLoggingInterceptor,RetryInterceptor,HelixMetadataInterceptor,RequestIdInterceptor, andDistributedTracingInterceptorpre-configured.- Returns:
- an
OkHttpClient
-
newDefaultClient
public static okhttp3.OkHttpClient newDefaultClient(io.micrometer.core.instrument.MeterRegistry registry) Creates a default OkHttpClient implementation with aHelixHttpLoggingInterceptor,RetryInterceptor,HelixMetadataInterceptor,RequestIdInterceptor, andDistributedTracingInterceptorpre-configured, as well as metrics wired into Micrometer.- Parameters:
registry- micrometer registry- Returns:
- an
OkHttpClient
-