Questions tagged [webflux]

101 questions
1
vote
0 answers

can't reach maximum performance of lettuce( spirng data redis reactive, webflux)

I wrote a sample WebFlux application, which read just some data from redis and do small cpu job(md5 calculation), repeats several time. It use spring data redis reactive 'org.springframework.boot:spring-boot-starter-data-redis-reactive' Codes that…
mouse500
  • 41
  • 4
1
vote
0 answers

Location of Java RSocket Fire And Forget send Payload to other connect client

I make some project use RSocket, and i refer that post, I want know where implement code send Message to other client logic. @MessageMapping("send") public Mono sendMessage(String p) { return this.messages.save(new Message(p,…
Leeseojune
  • 11
  • 1
1
vote
1 answer

In reactive programming how to elegantly close the connection in the database connection pool

Recently I am learning Spring WebFlux. And When I try to close my connection in the connection pool, it does not work! Code is like this: return connectionPool.create().flatMap(connection -> { Mono result =…
softgreet
  • 35
  • 3
1
vote
1 answer

How to use both reactive and non reactive MongoDB template on Webflux Application

Currently, I'm developing a springboot webflux app for my project, where I use reactive-mongo-template and other reactive implementations. Now I have a legacy spring boot application that is implemented by WebMvc ( here i dont use the real…
namila007
  • 1,044
  • 9
  • 26
1
vote
2 answers

WebFlux WebClient performance doesn't touch maximum of CPU

I'm writing a network intensive WebFlux application. When receiving request, application requests and recieves something with another external server and then reply to original requester. I'm talking about the WebFlux application, and I'm using…
mouse500
  • 41
  • 4
1
vote
0 answers

Spring Webflux returning null back to controller

Every time I think I understand Webflux and project reactor, I find out I have no idea. So I making some API calls... I want to call 1 first ... Get information back use that information, to make subsequent calls. so I do this like so public…
SoftwareSavant
  • 9,467
  • 27
  • 121
  • 195
1
vote
2 answers

How to conditionally publish an additional SSE web flux event after sending first 100 messages consumed from reactor kafka topic

I am consuming data from a kafka topic using reactor-kafka library with spring webflux SSE streams. I need to return a special ServerSentEvent when all the messages from the topic are consumed i.e. maximum topic offset get equals to current offset…
1
vote
1 answer

Webflux store result of Mono to session variable

My Spring Boot Webflux-application (Netty) outputs HTML using Thymeleaf-templates. In one handler-method I use WebClient to authenticate with an external id-provider. Now I'd like to store the resulting authentication token in a session-variable so…
mewers
  • 41
  • 5
1
vote
1 answer

Exception with Blockhound in Spring Webflux using Thymeleaf

When enabling Blockhound for production in my Spring Boot application, whenever I try to process a request that returns a view from thymeleaf, blockhound throws an exception (probably due to a block when reading template files from…
Basa
  • 105
  • 2
  • 15
1
vote
2 answers

How to use Spring WebClient to make multiple calls sequentionaly?

I read the topic How to use Spring WebClient to make multiple calls simultaneously? , but my case is a bit different. I'm calling 2 different external services using webclient, let's say from method Mono < Void > A() , followed by Mono < Void > B…
tarmogoyf
  • 298
  • 3
  • 17
1
vote
1 answer

Spring Cloud GlobalFilter: Resend modified request on failure

We are using Spring Cloud Gateway with a GlobalFilter to handle token injection to the request. Here is the code for the filter: @Override public Mono filter(final ServerWebExchange exchange, final GatewayFilterChain chain) { log.info("We…
olivergregorius
  • 109
  • 1
  • 7
1
vote
0 answers

Why is my Spring MVC (Tomcat NIO, RestHighLevelClient) outperforming Webflux (Netty, ReactiveElasticsearchClient) on load test?

I am new to reactive programming and webflux and I´m evaluating Migration from Spring Data Elasticsearch Application on Servlet Stack with WebMVC to Reactive Stack with Spring Webflux. I´ve developed two identical simple spring boot applications…
1
vote
1 answer

r2dbc validate if id exists and then insert row

I have following sql query with r2dbc: client.sql("INSERT INTO relation(id,rel_id) " + "VALUES(:id,:rel_id)") .filter((statement, executeFunction) -> statement.returnGeneratedValues("id").execute()) .bind("id", id) …
user1089362
  • 546
  • 7
  • 29
0
votes
0 answers

How I can call method using web client?

I wanna show new scene (JavaFX) when my post-request will be successfully completed, and show alerts when it will be 5xx/4xx errors. When i try to do this using WebFlux library, I getting error like "Bad return type in lambda expression: Optional…
Sergey
  • 29
  • 1
  • 5
0
votes
1 answer

Reactive programming - Return response when the result is empty

I have a reactive code below which does the following. query items table by ID - (itemRepository.findByd(itemId)) Create a map from the result from Step1 Invoke retrieveItemsQty from DB Here, it works fine when the Step1 returns one or more result…
user1578872
  • 7,808
  • 29
  • 108
  • 206