Questions tagged [spring-webclient]

WebClient makes it possible to perform reactive non-blocking HTTP requests in Spring applications. Use this tag for any questions involving its usage.

992 questions
0
votes
1 answer

reactor.netty.http.client.HttpClient as builder to create multiple function with different configs

Here I am creating a web client builder using HttpClient. How to create HttpClient builder to configure multiple configs on same httpclient. For example: in one function I am creating httpClient with proxy and in 2nd example with proxy and security.…
Neeraj Bansal
  • 380
  • 7
  • 23
0
votes
1 answer

webClient response using bodyToFlux method merging all the received response instead separating it out

I am using ParallelFlux for running many task. but when i am receiving webClient response using bodyToFlux method its merging all the output response instead of getting one by one. i want the output should be one by one not single string, is…
0
votes
1 answer

Recursively calling Mono functions with Reactive webclient

Need to call Mono from a Mono recursively to get form full Item. I have a Pojo Item , Here I will pass the root id and try to get the item from another service. I am writing my service using sprign webflux. So I am using the webclient to call the…
0
votes
1 answer

Throw new RuntimeException() from a Mono, in AOP

I have a reactive springboot application, in it an aspect @Before("approveRejectPointcut()") public void logAfterReturning(JoinPoint joinPoint) { Status newStatus = AspectUtils.returnFirstParameterOfTypeOrFail(allParameters, Status.class,…
0
votes
0 answers

Flux next() cause poor performance

I am new to reactive programming and I want to implement spring-webclient on our existing project. For simplicity, I created a pseudo code based from my original code. Here I am sending SMS to each provider. If condition is met then it will not…
0
votes
1 answer

How to get custom error body message in WebClient properly?

What i trying to achieve is to get my response error with 404 code and the error body with WebClient, how do i do this properly? here is my response with error code 404 and the body response from another API : { "timestamp":…
Ke Vin
  • 3,478
  • 11
  • 60
  • 91
0
votes
2 answers

Reading Server-Sent Events using reactive Spring WebClient and feeding them to a slow/restricted consumer produces an OverflowException

I have the following test: import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; import org.junit.jupiter.api.AfterEach; import…
0
votes
1 answer

Spring Configuring WebClient Oauth2 Authentication with Custom Request

I'm having some trouble understanding how to customize an authentication request made using Oauth2 when applying a ServerOAuth2AuthorizedClientExchangeFilterFunction filter on a WebClient.Builder that is used as a base for all WebClient…
0
votes
1 answer

How to stop webclient get() exchange() by calling executorService.shutdownNow()?

Please tell me how I can solve such thing? While I am trying to interrupt getting image from url through Spring WebFlux webClient - it does not stop. I have next code method1(){ ... ExecutorService executor = Executors.newFixedThreadPool(3); for…
r.gomboev
  • 73
  • 5
0
votes
1 answer

Spring webclient how to extract response body multiple times

how to re-use webclient client response? I am using webclient for synchronous request and response. I am new to webclient and not sure how to extract response body in multiple places WebClient webClient =…
Pratap A.K
  • 4,337
  • 11
  • 42
  • 79
0
votes
1 answer

WebClient Adding Handlers to Mono with ExchangeFilterFunctions

I am wondering if adding functionality to the Mono that I return from an ExchangeFilterFunction will be applied to the final Mono that gets returned. Basically I am wanting to clean up some of my client code by move some of the concerns out of the…
twreid
  • 1,453
  • 2
  • 22
  • 42
0
votes
1 answer

Spring WebClient POST to login.microsoftonline.com gives 404 error

I'm having a problem implementing Oauth2 with Azure AD using Spring Reactive WebClient (org.springframework.web.reactive.function.client.WebClient) in Kotlin, following this documentation:…
0
votes
1 answer

Java Spring WebClient how to get atribute from body response and set to a given class?

I'm trying to consume a given API that returns a body response like this: "access_token": "xkeo94s4qviHSTDIuTCbgRQSeNfrrMamiCN0w6wu", "token_type": "Bearer", "expires_in": 9600, "refresh_token": "PpF0LfLPmdsm9FJFu4YmDBPENqTwGQIqQjw8MqOP" So I…
0
votes
1 answer

Uncovering Mono to T class

I'm new to reactive components. I did an api call with webclient and the response was wrapped in a Mono component. Is there a way to check the value assigned to the object class in Mono component received. The received response is wrapped in…
Sam
  • 115
  • 2
  • 10
0
votes
1 answer

Call not propagating to the service method from Spring Reactive Controller

I am a beginner to the spring webflux. We are currently migrating our application to Spring Webflux. No I have stuck with a problem. The following is my scenario. The main service class is calling the following service classes for…