i’m trying to convert this method to an a reactive method I Have something like this but i don’t know how to conver the ArrayList to return an Mono<List> Answer If you really want a Mono, then just wrap the value that you want to transport in it: But I doubt you really want to return a list …
Tag: reactive-programming
Calling blocking endpoint on non-blocking asynchronous service
If my reactive endpoint needs to call an external, non-reactive endpoint which does blocking stuff, is my reactive endpoint still reactive? I have 2 services running that levergaes Spring Boot MVC and Spring Webflux. Service A Spring Webflux Service B Spring MVC Now my Service A which is reactive calling the …
flatMap reuse response from reactive call
Currently, I have a question, something like this: User X Y The question is how do I reuse correctly the “user” and the “x” response from the previous call? Here are my solutions for marked(*) place: nested flatMap(), then can thenReturn(user) for next map(). Any issue with the scope o…
Process List with synchronous delay after flatMap?
Hey I just started to dive into reactive programming and I can’t figure out how to process a List<String> in a synchronous way after flatMap. What I am trying to achieve: Get domain list from external service Filter out existing domains in database Make another http request to external service to …
Building a Recursive Data Structure with Spring WebFlux
I have a REST API that is built with the Spring WebFlux framework, and I have an endpoint which returns a Flux<ChannelResponse>, where ChannelResponse is a tree-structured object, as shown below: Now, I don’t have much experience with the reactive programming paradigm, but this is how I would impl…
Cold streams and publishers, is the Garbage Collector fully aware of its true death?
When instanceSubscriptorManager is unable to receive any more boolean values, the last thing to be performed will be a false as isActive, removing localConsumer from publisher. How is localConsumer “aware” that instanceSubscriptorManager will be unable to receive an isActive -> true (again) som…
Reactive – Improve Mono syntax
I have this block of code that works fine: To summarize it: calls the isBlacklistedToken function (returns a Mono<Boolean> with the result of the refresh token) If the refresh token is blacklisted, throws an UnauthorizedException If the refresh token is not blacklisted, does the same process for the acc…
How to chain operations with side effects?
I have two methods that allows to get an access to underlying storage in async manner I want to create another async method that will read value and delete it immediately with returning of read value. I was able to manage it in a really ugly way. But I’m sure more elegant and correct way to do it have t…
In the Response, i am getting scanAvailable=true when returning flux as ResponseEntity
I am slightly confused to get the proper response when the user tries to use two rest endpoints with WebClient. I want to use it as asynchronous and non-blocking in the code. I am returning the Flux from the controller. The code details are as below: The Controller Class method looks like this: It is calling …
Uni.combine().all().unis() v.s. Multi..onItem().transformToMultiAndConcatenate().collect()
In my Quarkus service, I need to fetch a list of results from external service, and I figured out there are two methods to achieve the same goal: 1st approach based on Uni.combine().all(): 2nd approach based on Multi..onItem().transformToMultiAndConcatenate().collect() In the beginning I don’t think the…