• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: execute 2 Mono sequentialy not supporte blocking

Resolved: execute 2 Mono sequentialy not supporte blocking

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve execute 2 Mono sequentialy not supporte blocking

Question:

i have the two bellow functions
i want when the function messageEvent is executed successfully i executethe getPersonById function, and the return of the getPersonById function is saved in the database
i tried like below
but i have this error

2023-03-09 21:56:20.191 ERROR 21080 — [nister-group]-0] c.s.e.v.s.q.i : Exception in on() with cause = ‘NULL’ and exception = ‘block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-2’ java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-2 at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83


)

Best Answer:

You need this operator from Mono:
So, in your code it probably could be like this:
And yes: don’t use block() in a Reactor Http thread.

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

java project-reactor reactive-programming spring spring-webflux
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How do I stop the command from happening if the requirements for it to work aren’t sert Discord.js

02/04/2023

Resolved: How to scroll bottom of div at launch?

02/04/2023

Resolved: how to get and read an xml file in a zip file using xml.etree

02/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.