quarkusvertx-eventbus

Quarkus Event bus is not working when deployed in OpenShift cluster but it works perfectly in local developer machine


I am publishing event and consuming event in the same Quarkus application. Earlier it used to work but recently it stop working, not sure of the cause why it stopped working. Here is the code sample.

import io.quarkus.vertx.ConsumeEvent;
import io.smallrye.common.annotation.Blocking;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

@ApplicationScoped
public class Consumer {

    @Inject
    Logger log;

    @ConsumeEvent(value = "excelRow", blocking = true)
    public void excelRow(RowData rowData) {
        log.info("Inside Excel row even bus");
    }
}
import io.vertx.mutiny.core.eventbus.EventBus;


public class EventProducer {

    Logger log = Logger.getLogger(EventProducer.class);
    private EventBus bus;

    public void setEventBus(EventBus bus) {
        this.bus = bus;
    }

    public void processRowData(Map<String, String> rowValues) {
        log.info("Reading a row complete, calling excelRow even bus");
        bus.publish("excelRow", rowData);
    }
}

This same code is working in local but not in OpenShift clusters, I have no idea on what to do to resolved this issue. Not configuration had be set for event bus.


Solution

  • Reference Quarkus vertx guide: quarkus.io/guides/vertx-reference

    Configuration: quarkus.vertx.event-loops-pool-size This configuration is for quarkus even bus. The number of event loops. By default, it matches the number of CPUs detected on the system.

    Once the above configuration is added it started working. enter image description here