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
0 answers

Spring 5 webflux inter-dependent webclient calls are not getting timeout

I have two interdependent webclient calls to different api's , when the first webclient call response is delayed then readtimeout excpetion is coming . but whenever the first call is success and the second call response is delayed then it is waiting…
0
votes
1 answer

Spring Boot to access OAuth2 protected resources without using HttpSecurity?

I would like to create a simple console spring boot application which should read an URL from terminal then print its data then again read another URL and print its data and so on till pressing CTRL + C. The grant type to be used should be client…
0
votes
1 answer

Azure COSMOSDB metrics - HttpClientErrorException$BadRequest: 400 Bad Request - Failed to consume REST API

Azure CosmosDB - "Mongo Query Request Rate" Metrics I want to fetch. Microsoft provided URL works fine when I use postman. But if I use WebClient or RestTemplate, it throws…
0
votes
1 answer

No data received from endpoint when using Spring WebClient but I can use curl to fetch the data

I have an endpoint which sends out server side events. For testing purposes I have made the endpoint deterministic and the connection to the endpoint terminates after 30 seconds. If I curl the endpoint I get all the data as expected: $ curl…
0
votes
0 answers

How to separate the execution of an HTTP request from the parsing of the HTTP response body using Spring WebClient?

I want to separate the execution of an HTTP request from the parsing of the HTTP response body using Spring WebClient. I want to write tests that test each of these concerns separately so that I can easily identify where an issue exists (in the…
Krzysztof Czelusniak
  • 1,217
  • 4
  • 16
  • 26
0
votes
1 answer

How to handle standard status with Spring WebClient?

I want to handle standard http errors the same way. How can I do it with Spring WebClient? Instead of hanging status check on each call below webClient.get() .uri("http://localhost:8081/resource") .retrieve() …
ntviet18
  • 752
  • 1
  • 10
  • 26
0
votes
1 answer

on error do another call and retry in webflux

I'd like to do the following using the WebClient from spring webflux: Call endpoint1 If it fails with an expected error then call endpoint2 and retry endpoint1 only once I've got this far: webclient.get() .uri("/endpoint1") .retrieve() …
pablo
  • 747
  • 1
  • 10
  • 24
0
votes
2 answers

unable to POST request with sprint WebClient : always 400

very big problem since 48h00. with postman, absolutly no problem to post my body. return is 200. there is no authentication with concerned api. but, when i use my java-code, always 400 is returned !!!! String baseUrl = "myBaseUrl"; String uri =…
electrode
  • 205
  • 1
  • 4
  • 16
0
votes
1 answer

Spring WebFlux How to get Flux execute result?

I want to use WebClient in Spring WebFlux to call some urls, and then put all the monos to flux. when I call Flux.blockLast, I can not get the results. @Test public void reactiveGetTest() { long start = System.currentTimeMillis(); …
-1
votes
0 answers

GraphQL Client Application issue

`Hi , I was trying to call an IBM content service graphQL URL from my application with spring boot . But getting an exception as mentioned below **Error Caused by: org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type…
-1
votes
1 answer

How to protect outgoing API calls with OAuth2 authorization in Spring Boot microservices while keeping incoming API calls unprotected?

I have two Spring Boot services, S1 and S2, both with their own API endpoints. S1 is protected with OAuth2 client credentials, so I have configured S2 as an OAuth2 client and am using WebClient to make API requests on S2. To achieve this, I added…
-1
votes
1 answer

Filtering Flux from a WebClient by Mono from another WebClient call mono

I have a public API with two endpoints. I have to get an Array of objects as Flux from the first GET endpoint THEN BY calling the second(internal call) GET endpoint Mono(Mono contains List of Objects ) where I have to find an internal Object by…
-1
votes
1 answer

How do I handle WebClient exceptions when using block()?

I have a service written using spring web. However, to perform our http calls we have decided to use WebClient (I do not have the option to use RestTemplate or convert the service to use WebFlux). So, in the block code below: public List
-1
votes
1 answer

WebFlux: how to use the block() method inside onErrorResume?

I'm new to reactive programming I want to save the object to the DB when handling an error, but as far as I know, calling the block() method is not the best practice mailFailureRepository.save(failure).block(); Is there a way to do this without…
-1
votes
1 answer

Not able to output WebClient call results

I'm learning more about using Spring Webflux and experimenting with testing a simple async webservice call. I've looked at several examples and I can't see what I'm doing wrong. I have a service that makes a call to a third party API and all I…
Sonik
  • 1
1 2 3
65
66