From 1c9120b43812ce84892ceb1da6013379bdf4e91d Mon Sep 17 00:00:00 2001 From: Marc Gorzala Date: Fri, 15 Dec 2023 09:49:35 +0100 Subject: [PATCH] debug --- .../dancer/chat/client/ChatServiceClient.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/dancier/dancer/chat/client/ChatServiceClient.java b/src/main/java/net/dancier/dancer/chat/client/ChatServiceClient.java index a9b98b1..dc5b391 100644 --- a/src/main/java/net/dancier/dancer/chat/client/ChatServiceClient.java +++ b/src/main/java/net/dancier/dancer/chat/client/ChatServiceClient.java @@ -1,5 +1,6 @@ package net.dancier.dancer.chat.client; +import io.netty.handler.logging.LogLevel; import net.dancier.dancer.chat.dto.ChatDto; import net.dancier.dancer.chat.dto.CreateChatDto; import net.dancier.dancer.chat.dto.ChatsDto; @@ -7,10 +8,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.stereotype.Service; import org.springframework.web.reactive.function.client.ExchangeFilterFunction; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClient; +import reactor.netty.transport.logging.AdvancedByteBufFormat; import reactor.util.retry.Retry; import javax.annotation.PostConstruct; @@ -31,12 +35,13 @@ public class ChatServiceClient { @PostConstruct public void init() { + var httpClient = HttpClient + .create() + .wiretap("reactor.netty.http.client.HttpClient", + LogLevel.INFO, AdvancedByteBufFormat.TEXTUAL); this.webClient = WebClient.builder() .baseUrl(host) - .filters(filtersConsumer -> { - filtersConsumer.add(buildRetryExchangeFilterFunction()); - filtersConsumer.add(logRequest()); - }) + .clientConnector(new ReactorClientHttpConnector(httpClient)) .filter(buildRetryExchangeFilterFunction()) .build(); }