Rajeev Massey (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63348a0...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiYWM1Y2E3...
) / Bug (
https://hibernate.atlassian.net/browse/HSEARCH-4709?atlOrigin=eyJpIjoiYWM...
) HSEARCH-4709 (
https://hibernate.atlassian.net/browse/HSEARCH-4709?atlOrigin=eyJpIjoiYWM...
) Custom HttpClientConfigurer Code unreachable (
https://hibernate.atlassian.net/browse/HSEARCH-4709?atlOrigin=eyJpIjoiYWM...
)
Issue Type: Bug Assignee: Unassigned Created: 28/Sep/2022 11:04 AM Priority: Major
Reporter: Rajeev Massey (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63348a0...
)
As per the documentation the HttpClientConfigurer code is not reachable therefore UUID in
the log trace is not being added.
********************************************************************************
public class HttpClientConfigurer implements ElasticsearchHttpClientConfigurer {
********************************************************************************
*********
@Override
*********
****************************************************************************
public void configure(ElasticsearchHttpClientConfigurationContext context) {
****************************************************************************
***************************************************************
HttpAsyncClientBuilder clientBuilder = context.clientBuilder();
***************************************************************
************************************************************************************************************************************************************
clientBuilder.addInterceptorFirst((HttpRequestInterceptor) (request, context12) -> {
h1. MDC.put("correlationId", UUID.randomUUID().toString()); h1. });
h1. clientBuilder.addInterceptorFirst((HttpResponseInterceptor) (response, context1) ->
{ h1. MDC.put("correlationId", UUID.randomUUID().toString()); h1. });
************************************************************************************************************************************************************
*
}
*
*
}
*
************************************************************************************************
hibernate.search.backend.client.configurer
=class:com.example.configuration.HttpClientConfigurer
************************************************************************************************
Note : MDC - > A Mapped Diagnostic Context, or MDC in short, is an instrument for
distinguishing interleaved log output from different sources. Log output is typically
interleaved when a server handles multiple clients near-simultaneously.
MDC.put("correlationId", UUID.randomUUID().toString());
add the correlationId UUID to the logging context.
*Main Goal is to generate logs with UUID for better tracing*
(
https://hibernate.atlassian.net/browse/HSEARCH-4709#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4709#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:ee9e30a )