-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Use the MongoDB Java driver's DNS SPI to enable mongo+srv:// connection strings in native mode #26388
Conversation
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.
I'm not an expert on DNS so if @cescoffier can have a look at the DNS part it would be great.
I added some suggestion on code simplification but overall it looks good to me.
I wonder if the config related code could be simplified by moving all the default options as default inside MongodbConfig and recovering the MongodbConfig
bean from Arc. This would allow to directly use the config attribute instead of using the Config
object.
integration-tests/mongodb-client/src/main/java/io/quarkus/it/mongodb/ReactiveBookResource.java
Outdated
Show resolved
Hide resolved
...ions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
Outdated
Show resolved
Hide resolved
...ions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
Outdated
Show resolved
Hide resolved
...ions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
Outdated
Show resolved
Hide resolved
...ions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
Outdated
Show resolved
Hide resolved
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.
@evanchooly as the code is a copy from the substitution, I approve the PR so if you don't have time to look at my other comments feel free to merge it.
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.
If I understand correctly, this PR switches to the Vert.x resolver in JVM and native mode.
I think we should provide an option where we allow using the default (JNDI-based) one in JVM mode, at least for compatibility purpose.
...godb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java
Outdated
Show resolved
Hide resolved
extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongodbConfig.java
Outdated
Show resolved
Hide resolved
...ions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
Outdated
Show resolved
Hide resolved
extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongodbConfig.java
Show resolved
Hide resolved
I was wondering about this but since it's SPI driven that gets rather complicated. I suppose we could switch inside the |
What if we do a class availability check on the JNDI types, use the driver's stuff if JNDI is present, or this "new" stuff if it's not? Then in JVM mode, it'd just use the driver's stuff and everything's peachy. but in native mode, JNDI wouldn't be there so we'd use this? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
i took a detour on other things but this is ready, i think. |
…on strings in native mode fixes #26387
@cescoffier what do you think of this now? |
fixes #26387