Sujay DSa
Sujay DSa

Reputation: 1192

Quarkus Hibernate Reactive Panache native transport error

I'm trying to set up a hibernate reactive panache system alongside a normal hibernate panache system in the same project. When trying to startup, I get an error saying that The Vertx instance must be created with the preferNativeTransport option set to true. Even though I have configured this, it is still showing the same error

Below is the WARN log

2024-06-06 10:30:26,888 INFO  [org.hib.rea.pro.imp.ReactiveIntegrator] (JPA Startup Thread) HR000001: Hibernate Reactive
2024-06-06 10:30:27,411 WARN  [org.hib.rea.pro.ser.ReactiveGenerationTarget] (vert.x-eventloop-thread-0) HR000021: DDL command failed [java.lang.IllegalArgumentException: The Vertx instance must be created with the preferNativeTransport option set to true to create domain sockets]
2024-06-06 10:30:27,427 WARN  [org.hib.rea.pro.ser.ReactiveGenerationTarget] (vert.x-eventloop-thread-0) HR000021: DDL command failed [java.lang.IllegalArgumentException: The Vertx instance must be created with the preferNativeTransport option set to true to create domain sockets]
2024-06-06 10:30:27,473 INFO  [io.qua.grp.run.GrpcServerRecorder] (main) Starting new Quarkus gRPC server (using Vert.x transport)...
2024-06-06 10:30:27,531 INFO  [io.quarkus] (main) quarkus-demo 1.0.0 on JVM (powered by Quarkus 3.10.0) started in 1.789s. Listening on: http://0.0.0.0:8081
2024-06-06 10:30:27,531 INFO  [io.quarkus] (main) Profile prod activated. 
2024-06-06 10:30:27,531 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, grpc-server, hibernate-orm, hibernate-orm-panache, hibernate-reactive, hibernate-reactive-panache, jdbc-mysql, narayana-jta, reactive-mysql-client, rest, smallrye-context-propagation, vertx]

This is my application.properties

quarkus.datasource.jdbc.url=jdbc:mysql://localhost:3306/test
quarkus.datasource.username=root
quarkus.datasource.password=password
quarkus.datasource.db-kind=mysql

quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.hibernate-orm.sql-load-script=import.sql
quarkus.hibernate-orm.log.sql=false

#quarkus.datasource.reactive.url=mysql:///test?host=/var/run/mysqld/mysqld.sock
quarkus.datasource.reactive.url = vertx-reactive:mysql://localhost:3306/test?host=/var/run/mysqld/mysqld.sock
quarkus.vertx.prefer-native-transport=true
quarkus.grpc.server.use-separate-server=false
quarkus.http.port=8081

here is my build.gradle dependencies

dependencies {
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation 'io.quarkus:quarkus-grpc'
    implementation 'io.quarkus:quarkus-hibernate-orm'
    implementation 'io.quarkus:quarkus-hibernate-reactive-panache'
    implementation 'io.quarkus:quarkus-hibernate-orm-panache'
    implementation 'io.quarkus:quarkus-hibernate-reactive'
    implementation 'io.quarkus:quarkus-container-image-docker'
    implementation 'io.quarkus:quarkus-jdbc-mysql'
    implementation 'io.quarkus:quarkus-reactive-mysql-client'
    implementation 'io.quarkus:quarkus-arc'
    implementation 'io.quarkus:quarkus-rest'
    testImplementation 'io.quarkus:quarkus-junit5'
}

What do I need to do for vertx to be started with native transport set to true?

Upvotes: 0

Views: 115

Answers (1)

Davide D'Alto
Davide D'Alto

Reputation: 8236

Currently, it's not possible to use Hibernate Reactive alongside Hibernate ORM in a Quarkus application.

We are tracking this annoying issue here: https://github.com/quarkusio/quarkus/issues/13425

Upvotes: 2

Related Questions