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 like: Now
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 same http call has been made due to
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 successfully. But in terms of performance, reactive paradigm, IO Utilisations to DB, Netty Core usage, what is the “best” solution
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 possible, since there in an unhandled exception in getSecondStepFromFirstStepAfterCheck
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 to be populated and I want to
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 can create an anonymous class implementing
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 protectionCommandService.sendUnprotected (deleteBBB). My secondservice method (invoked by
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 list. I need to consume these two APIs and
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’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. To enable CORS I