In this post, we will see how to resolve execute 2 Mono sequentialy not supporte blocking
Question:
i have the two bellow functionsmessageEvent
is executed successfully i executethe getPersonById
function, and the return of the getPersonById
function is saved in the databasei tried like below
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 fromMono
:block()
in a Reactor Http thread.If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com