Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Gorzala committed Dec 15, 2023
1 parent a9e6d99 commit 1c9120b
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
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;
import net.dancier.dancer.chat.dto.MessagesDto;
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;
Expand All @@ -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();
}
Expand Down

0 comments on commit 1c9120b

Please sign in to comment.