quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.97k stars 1.47k forks source link

FAILOVER Broker host or url setup not available with AMQP connector ? #1074

Open sangram725 opened 2 years ago

sangram725 commented 2 years ago

Hi, I was trying to achieve the failover from broker1 to broker2 qith AMQP-HOST attribute like we could achieve a setup of the failover:(brokerhost1;brokerhost2;broker) in qpid-jms. I didn't find a way to achieve the failover broker setup when using smallrye-reactive-messaging-AMQP. Kindly advise if any way to do the setup.

Thanks Sangram

cescoffier commented 2 years ago

I don't believe this is supported. How does the qpid configuration look like?

sangram725 commented 2 years ago

quarkus.qpid-jms.url=failover:(amqp://:5672,amqp://:5672,amqp://:5672)

Will this function be added and why its not added in the AMQP connector?

sangram725 commented 2 years ago

quarkus.qpid-jms.url=failover:(amqp://:5672,amqp://:5672,amqp://:5672)

Will this function be added and why its not added in the AMQP connector?

cescoffier commented 2 years ago

@gemmellr any idea if that's something that can be added? At the moment we configure the connector with a host and a port.

gemmellr commented 2 years ago

You would need to implement some form of failover handling behaviour in smallrye-reactive-messaging-amqp to provide such an option, handling the drops and connecting to the other servers instead if the first isnt available etc.

cescoffier commented 2 years ago

Is this just at connection time, or even during the execution of the application (a connection is cut, I retry, and if it fails I try the other host?

At startup, that sounds easy.

gemmellr commented 2 years ago

For the JMS client it is the latter.

cescoffier commented 2 years ago

Ok, that's way more complicated, especially if there is some state (credits and so on)

sangram725 commented 2 years ago

Ok, that's way more complicated, especially if there is some state (credits and so on)

So any plan for implementing it recently? This failover is a required functionality, atleast for me else I might not be able to use this AMQP connector. I really liked the connector but lacking this functionality causing me to go away from using it.

cescoffier commented 2 years ago

We could add this to the roadmap, but I cannot tell you when it will be implemented.

Failover is complicated and can quickly play dominos with your brokers. So, we need to define if we iterate the list, shuffle it, how many retry on each instance, jitter... maybe we should delegate that do Stork.

So, before implementing it, it needs to be carefully defined. If you expect something in the next few weeks, that most likely won't happen. However, contributions are more than welcome.

sangram725 commented 2 years ago

okk thnx ... I'll go with springboot/quarkus-qpid for now... but will follow with Small Rye once this works.