2

Using Quarkus hibernate Reactive Panache and the quarkiverse.reactivemessaging.http dependency trying to wright some data from a websocket connection into the database.

Works as expected but getting the following error on sum attempts.

Failed to process incoming web socket message.: java.lang.IllegalStateException: No current Vertx context found

Appears to be somewhat a random though request done together do appear to succeed.

  @Inject
  Mutiny.SessionFactory sf;

  @WithSession
  @Incoming("collector")
  Uni<Void> collect(final String text) {

    Mss msg = new Mss(text);
    return sf.withTransaction(session -> msg.persistAndFlush()).replaceWithVoid();

  }

Or

  @WithSession
  @Incoming("collector")
  Uni<Mss> collect(final String text) {
    Mss msg = new Mss(text);
    return msg.persist();
  }

Tried running on quarkus 2 but same issue as before

Edit getting the same effect with

@WithTransaction
@Incoming("collector")
public Uni<Void> collect(final String text) {
  System.out.println(text);
  return Uni.createFrom().voidItem();
}
alick
  • 21
  • 3

0 Answers0