Questions tagged [webflux]

101 questions
0
votes
1 answer

Migrating spring-statemachine factory to reactive webflux

I am trying to migrate my app that uses the spring statemachine to use webflux. I was using private final StateMachineFactory stateMachineFactory; [...] StateMachine machine =…
DiogoV
  • 1
0
votes
3 answers

Unable to return a request within webflux in reactive manner

Here is the following flow in my code: User calls create agency endpoint, containing the agency name and a boolean field -> Router functions receives call, passes to handler -> Handler converts request body to Mono, passes that mono so a service…
0
votes
1 answer

Filter multiple condition - reactor Flux/Mono filterWhen()

I am using Mono's filterWhen() with multiple conditions like below but don't know how to implement the correct way. Mono.just("a").filterWhen(item -> conditionA && conditionB)... // or Mono.just("a").filterWhen(item -> conditionA ||…
0
votes
1 answer

How subscribe in Webflux without using it?

I'm using WebFlux, and I want to log with AOP as follow: Class LogAop { @AfterReturning("execution ...") public void configSetted() { // Getting username by token Mono username = ReactiveSecurityContextHolder.getContext() …
Morteza Malvandi
  • 1,656
  • 7
  • 30
  • 73
0
votes
1 answer

Webflux post request: Only one connection receive subscriber allowed

I try to implement a springboot app that allow me to : upload mp3 on S3 extract meta data and store them on mongo DB. If i want to extract meta data from a mp3, I have to provide MultipartFile. Unfortunatelly, we can't send Flux. In my controller,…
davidvera
  • 1,292
  • 2
  • 24
  • 55
0
votes
1 answer

How to subscribe inside a WebFlux Controller

Inside a REST controller, I need to call a REST to obtain a value to be used as a URI variable to a second REST call. @PostMapping public void abbina(@RequestBody DocumentsUploadRequest documentsUploadRequest) { Mono result =…
0
votes
1 answer

Reactive Test case with Mono Stepverifier

I'm new to Reactive programming in spring webflux. I have the below scenario. While trying to write a test case for Mono> I'm getting an error. List response= List.of(MyResponse.builder() …
0
votes
1 answer

WebClient create java.lang.ExceptionInInitializerError: null ExchangeStrategies.withDefaults

I'm trying to play around Spring WebFlux Webclient. Tried to create a simple webclient in a quartz cron job this.webClient = WebClient.create(this.queryUrl); I made sure the queryUrl is valid. However, I've got an error as…
Jin Ma
  • 169
  • 2
  • 12
0
votes
1 answer

Serialize Map>

So I'm having a GET request with webflux as follows: suspend fun getProperties(): Map> { return webClient .get() .uri("/property/all") .retrieve() .bodyToMono(object…
0
votes
1 answer

How does delete mapping work with Spring WebFlux and Cassandra database?

I'm trying to get a handle on the Spring Web Flux. I was able to get the @getmapping to give me back my json parameters. And in the cassandra database I was able to delete a row using that command in the repository, but I can't delete a row from the…
Terry Light
  • 109
  • 1
  • 7
0
votes
2 answers

Spring Gatewayfilter (AUTH) How to Catch Error 500 and return the response from Auth-Service

Is there a way to catch the 500 Error and return the auth/userservice response instead of throwing? eg. "Token invalid" / "Token expired" - the userservice already provides the correct response @Override public GatewayFilter apply(Config…
Soios
  • 27
  • 1
  • 7
0
votes
1 answer

Extract Principal from the request in WebFlux

So I am using webflux and I have a filter where I am logging all the requests. When logging an authenticated request I try exctract the principal from the request object which is a Mono I tried to get the value by using .block method but I got an…
tinashe.chipomho
  • 387
  • 2
  • 8
  • 17
0
votes
2 answers

How do I return different response in the webflux based on whether the Flux object has elements?

I know there is a function named "hasElements" on a Flux object. But it behaves a bit strange! Flux rooms=serverRequest.bodyToMono(PageBO.class).flatMapMany(roomRepository::getRooms); return rooms.hasElements().flatMap(aBool ->…
softgreet
  • 35
  • 3
0
votes
1 answer

How to get Flux-Results into a set of a Mono-Bean

I have the following scenario: I have a ProductFamily that has a set of Products. I load the ProduktFamily from the database and then I want to load its Products and insert them into ProduktFamily.products. Easy in Spring MVC (because of JPA) but…
MarkusJackson
  • 225
  • 2
  • 12
0
votes
0 answers

How to validate error body in Webflux/Webclient

I have a handler method for an endpoint, that is this one: public Mono create(ServerRequest serverRequest) { Validator validator = new CreateUserValidator(); Mono userDtoMono =…
AleGallagher
  • 1,745
  • 7
  • 30
  • 40