Questions tagged [spring-reactive]

128 questions
1
vote
1 answer

How to generate a random string and push it out using Mono to be displayed in a browser every X seconds or with random delay through Spring Reactive?

I would like the browser to display the randomly generated string on the browser as soon as the API generates it using Spring Reactive Mono. Following is my sample program that works, generates random string and displays it on the browser every…
Nital
  • 5,784
  • 26
  • 103
  • 195
0
votes
1 answer

Working example of Spring boot reactive and EventSource

I'm trying to have a working spring boot with reactive mongodb and EventSource. However, I'm facing issues with the repetitive reopening of the connection because it's closed by the server. I even have some doubt if this could really work since I…
user12776952
0
votes
1 answer

Using reactor context to get back results from downstram chain

I got this bean: @Bean("reactiveNeo4jDatabaseNameProvider") public ReactiveDatabaseSelectionProvider reactiveDatabaseSelectionProvider() { log.info("Database selection step"); return () -> getRealmFromContext() .flatMap(realmId…
FrankBr
  • 886
  • 2
  • 16
  • 37
0
votes
1 answer

Is there any risk in having reactive approach micro-services for API integration (direct using WebClient) ,without any message broker?

I am implementing microservices API however not planning to have any message broker. API Services will talk to each other with WebClient/web flux. Not using any message broker due to skill/budget challenges. Is there any risk of going production…
0
votes
1 answer

How to create a generic wrapper for just any method call?

I want to create a helper method that can wrap/convert just any sync method call into an async Mono. The following is close, but shows an error: Required type: Mono Provided: Mono> This is my code: public
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

How to stop main thread to complete all Mono calls?

I'm making multiple mono calls to DB.And result of all Mono response is needed to compute final result which is written after declared Mono logic. if (SomeObject.getAccountLevelActiveList() != null) { …
John
  • 59
  • 6
0
votes
1 answer

Spring Boot Webflux Handler errors when decoding XML request body content to Mono or Flux object

I have been trying to implement Spring reactive routers and handler instead of MVC controllers. Seemed simple enough, but my WebTestClient test has been failing with 500 Internal Server Error. Shorted code versoin of…
0
votes
0 answers

Custom Health Indicator for multiple instances of a Spring Boot Application

I have a Spring Boot (2.3.3) application which is deployed on PCF and it has 5 instances running. For monitoring the health of this application, I added the custom health indicator where I implemented/override the ReactiveHealthIndicator of actuator…
0
votes
1 answer

webClient response using bodyToFlux method merging all the received response instead separating it out

I am using ParallelFlux for running many task. but when i am receiving webClient response using bodyToFlux method its merging all the output response instead of getting one by one. i want the output should be one by one not single string, is…
0
votes
1 answer

Spring Reactive WebSocket does not come up when spring-web is present

I have an existing spring web application that uses spring-boot-starter-web; I have been planning to introduce reactive into this application. For a new feature that I am working, I have pulled in spring reactive web socket, configured and coded as…
Venkatesh Laguduva
  • 13,448
  • 6
  • 33
  • 45
0
votes
2 answers

How to get User object from Mono without blocking it in Java?

I have a repository call which will give me Mono . ex: private User getUserData (User user) { Mono monoUser=userRepository.insert(user); User user= monoUser.block; return user; } How to achieve this without blocking in spring…
Ravi sinha
  • 119
  • 4
  • 12
0
votes
1 answer

Spring Cloud Function and Dead Letter Exchange

I am trying to write a reactive Spring Cloud Function service using RabbitMQ which will consume off one queue and produce to an exchange. I have 2 questions. Why am I getting the error below in the logs. How would I do a reject with a doOnError?…
0
votes
1 answer

How to handle exception in flatmap - reactive spring

See this code: somePostRequest .bodyToMono(String.class) .flatMap(token -> Mono.just(addTokenToMap(token,bankCode))); Problem here is that the method: addTokenToMap() - needs to be wrapped in try catch block - which I am looking to avoid. Is…
0
votes
1 answer

Identifying UriBuilder implementation used by Spring WebClient

I use the below syntax to make a get call using get client. In the below example , which implementation of URIBuilder is being used and how is automatically inferenced? webclient.get().uri(uriBuilder -> uriBuilder.path("/api/person/{personId}") …
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
0
votes
1 answer

$or operator with multiple expressions and multiple fields in an expression using Spring Data Reactive MonogoDB

In MongoDB, I can use $or[{key1:'value11', key2:'value12'}, {key1:'value21', key2:'value22'}, {key1:'value31', key2:'value32'}, ...] to query several documents which matches at least one of the expressions in the $or operator. Then how the thing can…
Tonny Tc
  • 852
  • 1
  • 12
  • 37
1 2 3
8 9