I have this scenario. I have one paginated API which gives me the data for last 12 months. The response of the API is like: Now I have to collect all the data and then calculate the sum of all the netReceivable and return as a Mono<CompanyIncome>. This pojo is like To do this I have written something li…
Tag: spring-webflux
Is Reactor chain still running
I have an application based on Spring WebFlux and Reactor. Application starts everyday on a schedule and loads statistics. But there is also available a manual launch option through controller. So if …
Resilience4j Retry – logging retry attempts from client?
Is it possible to log retries attempts on client side with resilience4j please? Maybe via some kind of configuration, or settings. Currently, I am using resilience4j with Spring boot Webflux annotation based. It is working great, the project is amazing. While we put server logs on server side, to see that a s…
Spring Webflux – reactive repository saveAll(Iterable) vs saveAll(Publisher)
Small question about the webflux reactive repository, especially about the methods saveAll Flux saveAll(Iterable var1); versus Flux saveAll(Publisher var1); Wanted to compare, I wrote the following: In terms of “correctness” both codes are doing what is expected. Everything is persisted successful…
Spring Webflux – Proper way to throw checked custom exception (not RuntimeException)
May I ask what is the proper way to throw checked custom exception in Spring webflux please? I would like to insist, it is about checked custom exception, like MyException.java, not something like RuntimeException, and it is about throwing exception, not handling exception. I tried the following : This is not…
Repeatedly filter a response using Spring WebClient
I’m new to Spring and even newer to WebClient. I want to filter the body of a Get response repeatedly with one second intervals for 2 minute duration using Springs’ WebClient. I’m performing a get request which returns an empty JSON list of strings. At some moment of time the body is going t…
WebClient – adding defaultHeaders
I’m trying to put multiple headers into defaultHeaders(), But I don’t have idea how to create Consumer object from return of createHeaders() method I can build my header in that way: but how to wrap it into Consumer? Answer Clearly the method doc says that it needs a Consumer of some Type. So you …
Which design pattern for merging 2 methods they differ in one place
I wonder which design pattern should I use in my case: I have 2 endpoints that use 2 service methods, each very similar, they differ only in invoking some different methods from the same service: My first service method (invoked by endpoint 1): The second endpoint uses very similar method that differs in prot…
Merge two api responses into one using Webclient – Webflux
I’m using WebFlux and WebClient and I need to consume two APIs and merge its responses. The first API receive type and document number and returns a list with one element that contains customer data (that’s how it’s defined). The second API receive a client id and returns a customer payments…
WebTestClient – CORS with Spring Boot and Webflux
I have Vuejs frontend and a Spring Boot Webflux controller. Now the browser is complaining with CORS when doing a call to Spring Boot. Access to XMLHttpRequest at ‘https://…’ from origin ‘https://…’ has been blocked by CORS policy: Response to preflight request doesn’…