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

I have a complicated set of tasks using Java Web-Client requests that need to run in parallel and finally block to return a single response

I am new to the Web Client reactive library. Here is my problem : It starts with a user submitting a request to post a packet of documents. They wait for a response. A service consuming this request needs to run several tasks in parallel. Some of…
0
votes
1 answer

How to call Oauth2 protected endpoint from a Spring Boot Java Client using WebClient "serverWebExchange cannot be null"

The requirement is to call an OAuth Protected endpoint from a java client program using WebClient. I'm using Password Grant authorization type using Reactive objects. Please note I'm very novice to reactive programming mode. When I make the…
0
votes
1 answer

After update do spring-boot 2.3.0 webflux webclient ignores added jackson2JsonDecoder

After I've updated to spring-boot 2.3.0 (so my webflux WebClient is now from version 5.2.6) custom ObjectMapper is completely ignored. My configuration looks as follows public static WebClient buildWebClient(WebClient.Builder builder) { return…
ppysz
  • 380
  • 5
  • 21
0
votes
0 answers

Spring 5 WebClient Mono.subscribe with handle leak

Update: it's a bug of springboot. https://github.com/spring-projects/spring-boot/issues/22091 I'm a beginner in springframe. There are some problems when using webclient. I can get the desired return information in the subscribe but after all the…
0
votes
2 answers

How can I change the url webClient based on reactor context

Based on a country already added on a webfilter, I need to modify the request to a different server. I already added the context with the webfilter to the chain, I can see it here, but I didn't find how to modify the received clientRequest based on…
0
votes
1 answer

WebClient giving MediaType not supported Exception when using class with custom getter setter as RequestBody

I have class all classes in my spring Webflux Application which has getter/setters without get and set prefix and setter return this. Hence i have also defined my custom Jackson Configuration for that which works fine with all my controllers…
Luv
  • 169
  • 2
  • 13
0
votes
1 answer

How to use bodyToFlux for different type of subclasses emitted from server to match appropriate object type

I have emitter over http which is emitting events of different object types(different subclasses). A webclient which is subscribe to this stream need to check the type of event transmitted(map to type of object). How to achieve it as instance of…
0
votes
2 answers

Avoid multiple calls to API using spring webclient with flux

Both those calls are client http api: Flux views = savingsApi.getViewFilterSavings(viewId); Flux groups = groupsApi.getAllGroups(); and return a Flux requestBodySpec.retrieve().bodyToFlux(returnType); I need…
0
votes
1 answer

Spring WebClient: Passing username and password in request body to get a token

Following the Spring WebClient tutorial here I'm trying to pass username and password in the request body (no basic auth) to the API endpoint as it expects these as parameters. I've tested in Postman supplying the username and password as separate…
algorhythm
  • 3,304
  • 6
  • 36
  • 56
0
votes
1 answer

Spring Vault Kubernetes Auth not accepting custom mount path

Using Spring Vault 2.1.2 and I cannot upgrade. I am configuring an AbstractReactiveVaultConfiguration to use KubernetesAuthentication. @Configuration public class VaultConfiguration extends AbstractReactiveVaultConfiguration { …
Lurk21
  • 2,307
  • 12
  • 37
  • 55
0
votes
3 answers

Spring Boot RestTemplate WebClient - Response Body JSON Empty

I am using Rest Template and have used Web Client as well. I get the key in response but the body is empty always. Using Postman I can see the Response which is a JSON. My code snippet is below - HttpHeaders headers = new HttpHeaders(); …
Arpan Sharma
  • 395
  • 1
  • 10
  • 20
0
votes
1 answer

Spring Boot - WebFlux keep context of result with id when running i parallel

Using Spring boot Web client to request JSON from a REST API, the response body from the server is stored in a simple Map. The request to the server contains an ID, but this isn't included in the response, but is required to interpret the…
Linor
  • 55
  • 1
  • 5
0
votes
1 answer

Using spring Web Client hit https rest service

I have got two .cer file from client now my goal is to hit client api using https rather than http using spring webclient . As I am new to spring webclient not getting clue what to do I have imported both .cer in keystore using below command keytool…
0
votes
0 answers

How to get a new access token by checking the lifetime of the previous one if it's expired or not in spring webffux?

I am working on a project where the server provide only an access token without the refresh token for some company needs. Referring to official docs, the following code will automatically refresh the access token when it's expired if a refresh token…
0
votes
1 answer

Spring WebClient - chaining async calls

I'm building a plain old Java desktop application with Swing, but needs to make Rest calls to a backend. Since we're in a modern async world, and the tools exists, i want to make async calls to the backend, display a progressbar, and hide it when…
JSlain
  • 566
  • 3
  • 20