0

I randomly receive this exception within my application: HR000065: No Vert.x context active

java.lang.IllegalStateException: HR000065: No Vert.x context active

2021-11-09T17:12:18.143+02:00 at org.hibernate.reactive.context.impl.VertxContext.put(VertxContext.java:41) ~[hibernate-reactive-core-1.0.1.Final.jar!/:1.0.1.Final]

2021-11-09T17:12:18.143+02:00 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

2021-11-09T17:12:18.143+02:00 Error has been observed at the following site(s):

2021-11-09T17:12:18.143+02:00 |_ checkpoint ⇢ Handler com.nflp.processingapplication.main.modules.authentication.controller.PrincipalController#getUserAuthentication() [DispatcherHandler]

2021-11-09T17:12:18.143+02:00 |_ checkpoint ⇢ com.nflp.processingapplication.main.modules.api.shared.filter.ApiExceptionFilter

It does not always occur, but after a couple of times, I start receiving timeout exceptions on any request to the db, which looks like the connection is never released. Also, I only receive this error in the prod environment - we are using aws rds, it works perfectly fine locally, even when I create an ssh tunnel to the rds instance and connect to prod db locally. I only use methods like withTransaction and withSession in my application, so I do not expect it to be an issue with implementation of functionality.

1 Answers1

0

Issue was related to the fact that I was using Stage.Session implementation of the api and converting it into the Reactive Java streams [Flux, Mono]using Mono.fromCompleationStage(). After switching to Mutiny api I was no longer able to reproduce this issue.

  • Hello @Dmytro Kostyushko, I'm looking for example, how to use `VertxContext` along the mutiny pipeline (reactive stream), do you mind showing a few lines of code? – Guy Assaf Jan 14 '22 at 10:07