Category "spring-webflux"

Spring Webflux - initial message without subscriber

I am trying to make an SSE Spring application, using Webflux. According to the documentation, the message is not sent to the sink if there is no subscriber. In

How do I create a hot flux that will provide data and replenish itself as needed

Since SecureRandom is slow, I was wondering how to make it so that I have a Flux that I can request the next random number, but it is prepopulated by say 100 it

What Does MapReactiveUserDetailsService Do in Spring Webflux Security Authentication?

I'm trying to implement Spring Security authentication on Spring WebFlux app. I have implemented Spring Security authentication on Spring Web before. When I rea

Spring Webflux - Database connection metrics

Small question regarding database connection metrics for Spring Webflux (2.6+) web application please. For the SpringBoot (non Webflux) apps, connecting to JDBC

Make R2DBC use the same connection for all interactions with the database in a @Transactional method (Java, Sprint)

Motivation I have a service which I want to make @Transactional. My service is storing complex data in multiple tables, there is a referential integrity between

R2DBC - IllegalArgumentException: Cannot encode parameter of type java.util.Date

I'm learning Reative jdbc with R2DBC MySQL. I have a repository like this: public interface VerificationTokenRepository extends ReactiveCrudRepository<Verifi

Ordering multiple HandlerFilterfunction in SpringWebflux

If I have multiple HandlerFilterFunctions in my route config, how do I guarantee the order of their execution? In the code below, how does one ensure that Filte

Unable to create a ConnectionFactory Error with H2 and R2DBC in Spring Boot with WebFlux

I've created a Java Spring Boot service using the WebFlux reactive module, H2 in-memory database, and R2DBC reactive driver. When I run the service, it fails wi

How to get requests path with unresolved variables in Spring WebFlux

I'm trying to get the request's path with unresolved path variables in a WebFilter. I know in SpringBoot Servlet version it is possible to do this by getting re

Why is reactor context throwing "Context does not contain key" when .block() is called?

I have a WebFilter that injects a context public class MyWebFilter implements WebFilter { @Override public Mono<Void> filter(ServerWebExchange exchang

Exception Handling for async WebClient request

Recently I have been working with WebClient. I am creating both a sync request and an async request. In a sync request, I am able to catch WebClientResponseExce

Change request body in ServerHttpRequestDecorator using AbstractGatewayFilterFactory - Webflux

Spring Boot Version: 2.5.1, Spring Cloud Version: 2020.0.3 Hello guys !!! I need your help ... My question is that I can't modify the request body in spring gat

URLConnection equivalent in Spring Webflux

Is there an equivalent class for URLConnection in Spring Webflux? I'd like to convert this in Spring Webflux: I tried using WebClient but didn't work, I can't

Spring Webflux and non-blocking logging with log4j2

It is well known fact we should not block in a Spring Webflux applications. In the SpringOne conferences (2020 and 2020), as well as other conferences, several

Would delayElement be susceptible to a DoS attack?

I have a service that authenticates a user and I put delayElement for 2 seconds when it is about to return a 401. When I run through artillery, it seems to star

Extract WebClient GET response values within a Spring Cloud Gateway filter

My end goal with this is to implement a way to make composite API calls within the body of a gateway route filter. I have a very basic demo application running

How do I prevent RSocket from allowing cross origin in Spring Boot?

My Problem I have a spring boot application that uses RSockets. My spring boot app is running on port 8080, and my front-end (React.js) is running on port 3000.

Get body as raw string from ServerWebExchange/ServerHttpRequest

I need to get the request body as a raw JSON string in my controller. I'm using Spring WebFlux. If I could change @PostMapper function signature, it will be so

Spring Reactor onErrorContinue not working

As per documentation I am expecting onErrorContinue will ignore the error element and continue the sequence. Below test case is failing with exception java.lan

Understanding Mono.when

I'm new to Spring WebFlux and do not fully understand the Mono.when(). The following code does not work as expected: List<Mono<Void>> results= ....;