You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It listens to both addresses, notice the blocking = true parameter in the annotations. They wait a little to see if the code execution is really blocked.
When I run the application this is what I would expect from the logs:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am not sure what I observed is a bug or intended behaviour, so I am posting a question here.
In the guide about using the vertx "EventBus", it is stated that the consuming of the events can be configured to be blocking:
https://quarkus.io/guides/reactive-event-bus#consuming-events
I made a small test project where I tested this and it seems that the publisher is not blocked until the consumer is finished.
Test project:
https://github.com/bublag/test-quarkus-event-bus-blocking
Used Quarkus version: 3.28.3
This is how my publisher method looks:
https://github.com/bublag/test-quarkus-event-bus-blocking/blob/a6c625ccc841412f1d366903c379fddbe90c49b5/src/main/java/org/acme/vertx/VertxEventPublisher.java#L16
It sends messages into two different addresses: message
greeting1into addressvertxEvent1, andgreeting2into addressvertxEvent2.Here is my consumer:
https://github.com/bublag/test-quarkus-event-bus-blocking/blob/a6c625ccc841412f1d366903c379fddbe90c49b5/src/main/java/org/acme/vertx/VertxEventConsumer.java
It listens to both addresses, notice the
blocking = trueparameter in the annotations. They wait a little to see if the code execution is really blocked.When I run the application this is what I would expect from the logs:
But this is what happens:
Is this a bug, or my expectation is wrong?
P.S. I also checked how the same behaves with the "jakarta event bus", and that one works how I expected the blocking behaviour should work. It is commented out here in my test project:
https://github.com/bublag/test-quarkus-event-bus-blocking/blob/a6c625ccc841412f1d366903c379fddbe90c49b5/src/main/java/org/acme/jakarta/JakartaEventPublisher.java#L19
and the consumer for that:
https://github.com/bublag/test-quarkus-event-bus-blocking/blob/a6c625ccc841412f1d366903c379fddbe90c49b5/src/main/java/org/acme/jakarta/JakartaEventConsumer.java
Beta Was this translation helpful? Give feedback.
All reactions