-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support fault tolerance and load balance with vert.x pool of reactive mysql client #31852
Support fault tolerance and load balance with vert.x pool of reactive mysql client #31852
Conversation
…reactive-mysql-client-quarkus3-fix # Conflicts: # extensions/reactive-mysql-client/runtime/src/main/java/io/quarkus/reactive/mysql/client/runtime/MySQLPoolRecorder.java
LGTM in principle, but I've never used this capability; better to rely on review from others about it being suitable. Wouldn't it need some documentation changes? It certainly needs to be squashed. |
This comment has been minimized.
This comment has been minimized.
PArodn my ignorance, but it's fault tolerance, right? Is |
@cescoffier Here the fault tolerance is about connection to mysql. With vert.x pool of mysql client, we can create connections to the servers in pool. In case of one server down and cause an active connection is broke, we still can use other alive connections in pool. |
We need @tsegismont review - he is the expert. |
I'll review it today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @benstonezhang
I think it is a good idea to support connection load-balancing.
Nevertheless, instead of parsing the url, I would prefer we change its type in DataSourceReactiveRuntimeConfig
:
Line 29 in 96605e8
public Optional<String> url = Optional.empty(); |
Instead of a Optional<String>
field, we could have Optional<List<String>>
.
Existing configurations wouldn't be broken, and users could configure it with either several values comma-separated, or Indexed Properties.
That's great. It would be more clear. |
@tsegismont The change of |
Right, the change would be relatively bigger. On the other hand, it would be more maintainable on the long term. If you're willing to update the PR, I will review it. |
OK. I will work on it and update the PR. |
@tsegismont I create a new PR #31994 name as "Support config reactive datasource with list of database urls for fault tolerance and load balance". Please review. |
PR move to #31994. Close this one. |
Add support to config load balance url for reactive mysql datasources in application.properties, for example
quarkus.datasource.reactive.url=mysql:loadbalance://192.168.32.101:3306,192.168.32.102:3306/dbname
or more simple
quarkus.datasource.reactive.url=mysql://192.168.32.101:3306,192.168.32.102:3306/dbname