Class RequestIdInterceptor
java.lang.Object
com.helixframework.okhttp.requestid.RequestIdInterceptor
- All Implemented Interfaces:
okhttp3.Interceptor
OkHttp interceptor that sets the upstream request id, found in the Helix context, onto downstream calls automatically.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface okhttp3.Interceptor
okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the variable in the request context and MDC that holds the current request id.Fields inherited from interface okhttp3.Interceptor
Companion -
Method Summary
Modifier and TypeMethodDescriptionstatic RequestIdInterceptor.Builderbuilder()Creates a builder forRequestIdInterceptor.okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain) static RequestIdInterceptorstandard()Creates an instance ofRequestIdInterceptorwith the standard default configuration.
-
Field Details
-
REQUEST_ID_CTX_NAME
Name of the variable in the request context and MDC that holds the current request id.- See Also:
-
-
Method Details
-
builder
Creates a builder forRequestIdInterceptor.- Returns:
- a
RequestIdInterceptor.Builder
-
standard
Creates an instance ofRequestIdInterceptorwith the standard default configuration.- Returns:
- a
RequestIdInterceptor
-
intercept
@NotNull public okhttp3.Response intercept(@NotNull okhttp3.Interceptor.Chain chain) throws IOException - Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-