quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

dev mode reload - rabbitmq - multiple rabbitmq connections #39433

Open rastislavpapp opened 7 months ago

rastislavpapp commented 7 months ago

Describe the bug

I'm consuming from a rabbitmq queue in my quarkus app. When reloading the app in dev mode, I'm expecting that the app will disconnect from RabbitMQ, and then connect again. This is what happens, but after the reload, there is 2 connections to the queue instead of 1. I think it's because when disconnecting, a shutdown handler of a queue consumer is triggered (see io.vertx.rabbitmq.impl.RabbitMQClientImpl#basicConsumer), which reconnects back. And then the app reloads and connects again.

Expected behavior

after dev mode reload, there should be only 1 connection to consumed queue

Actual behavior

after dev mode reload, there are multiple connections to consumed queue

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 7 months ago

/cc @cescoffier (reactive-messaging), @ozangunalp (reactive-messaging)

cescoffier commented 7 months ago

Which version of Quarkus are you using? I fixed an issue related to that recently.

rastislavpapp commented 7 months ago

3.8.2

cescoffier commented 7 months ago

Could you provide a standalone minimal reproducer?

rastislavpapp commented 4 months ago

Reproduction would need an existing rabbitmq server, as using devservices would affect the problem itself (I think, I can't get docker to work on my machine because of company policy)... so the reproducer would just be an app with a connection to rabbitmq server. I created a simple one - https://github.com/rastislavpapp/quarkus-39433-bug-reproducer

The issue happens every time I restart (via dev mode).

seb5433 commented 1 week ago

@rastislavpapp did you find a temporary solution for this bug?