This is my webclient config in Spring Boot Webflux
@Bean("tokenExchangeNoTanRequired")
@Scope(SCOPE_PROTOTYPE)
public WebClient.Builder tokenExchangeNoTanRequiredWebClientBuilder(
@Qualifier("exchangeBearerTokenNoTanRequiredFilter") ExchangeFilterFunction filter) throws SSLException {
return WebClient.builder()
.clientConnector(getClientConnector())
.filter(filter);
}
private ClientHttpConnector getClientConnector() throws SSLException {
return new ReactorClientHttpConnector(getHttpClient());
}
private HttpClient getHttpClient() throws SSLException {
SslContext sslContext = SslContextBuilder
.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.build();
return HttpClient
.create()
.secure(t -> t.sslContext(sslContext))
.wiretap(this.getClass().getCanonicalName(), LogLevel.INFO, AdvancedByteBufFormat.TEXTUAL)
.responseTimeout(Duration.of(this.responseTimeout, MILLIS));
}
}
I want to set every request and response to have a traceId and spanId for log tracing; I use Spring Boot 3 and Micrometer tracing but in my elasticSerch log traceId and spanId don't exist.