Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems configuring clustered Vertx Eventbus in Quarkus

I'm using:

  • Quarkus 1.6.1.Final
  • Vertx 3.9.1 (provided by quarkus-vertx dependency, see pom.xml below)

And I can't get the clusered Eventbus working. I've followed the instructions listed here:

https://vertx.io/docs/vertx-hazelcast/java/

I've also enabled clustering in Quarkus:

quarkus.vertx.cluster.clustered=true
quarkus.vertx.cluster.port=8081
quarkus.vertx.prefer-native-transport=true
quarkus.http.port=8080

And here is my pom.xml:

    <dependencies>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-resteasy</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-resteasy-mutiny</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-vertx</artifactId>
    </dependency>
    <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-hazelcast</artifactId>
        <version>3.9.2</version>
        <exclusions>
            <exclusion>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-core</artifactId>
            </exclusion>
            <!--                <exclusion>-->
            <!--                    <groupId>com.hazelcast</groupId>-->
            <!--                    <artifactId>hazelcast</artifactId>-->
            <!--                </exclusion>-->
        </exclusions>
    </dependency>
  <!--        <dependency>-->
  <!--            <groupId>com.hazelcast</groupId>-->
  <!--            <artifactId>hazelcast-all</artifactId>-->
  <!--            <version>3.9</version>-->
  <!--        </dependency>-->
    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport-native-epoll</artifactId>
        <classifier>linux-x86_64</classifier>
    </dependency>      
   </dependencies>

And the error I get is the following:

Caused by: java.lang.ClassNotFoundException: com.hazelcast.core.MembershipListener

As you can see in my pom.xml, I've also added the dependency hazelcast-all:3.9 and excluded the hazelcast dependency from vertx-hazelcast:3.9.2, then this error disappears but another comes up:

Caused by: com.hazelcast.config.InvalidConfigurationException: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.hazelcast.com/schema/config":memcache-protocol}'. One of '{"http://www.hazelcast.com/schema/config":public-address, "http://www.hazelcast.com/schema/config":reuse-address, "http://www.hazelcast.com/schema/config":outbound-ports, "http://www.hazelcast.com/schema/config":join, "http://www.hazelcast.com/schema/config":interfaces, "http://www.hazelcast.com/schema/config":ssl, "http://www.hazelcast.com/schema/config":socket-interceptor, "http://www.hazelcast.com/schema/config":symmetric-encryption, "http://www.hazelcast.com/schema/config":member-address-provider}' is expected.

Am I doing something wrong or forgetting something, or is this simply a bug in Quarkus or in Vertx ?

Thx in advance for any help.

like image 387
Serkan Avatar asked Oct 31 '25 20:10

Serkan


2 Answers

I think the most probable reason of your issue is that you are using the quarkus-universe-bom which enforces a version of Hazelcast (we have an Hazelcast extension there) which is not compatible with vertx-hazelcast.

Check your dependency tree with mvn dependency:tree and make sure the Hazelcast artifacts are of the version required by vertx-hazelcast.

Another option would be to simply use the quarkus-bom which does not enforce an Hazelcast version and let vertx-hazelcast drag the dependency by itself.

like image 147
Guillaume Smet Avatar answered Nov 04 '25 08:11

Guillaume Smet


It seems like a bug in Quarkus and this issue is related to:

https://github.com/quarkusio/quarkus/issues/10889

like image 26
Serkan Avatar answered Nov 04 '25 08:11

Serkan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!