Open
Description
openedon Oct 31, 2024
Describe the bug
/**
* Configures the MongoDB server addressed (one if single mode).
* The addresses are passed as {@code host:port}.
*/
@ConfigItem(defaultValue = "127.0.0.1:27017")
public List<String> hosts;
Quarkus pre configure hosts of mongoclient with defaultValue 127.0.0.1:27017, when i dont set my connectionstring on properties and create a custom mongoclient config implementing the interface MongoClientCustomizer and setting the connectionstring with SRV host, the driver throw an exception because it thinks that the mongoclient is configured with two types of connectionstring.
Expected behavior
Permit creating my customized connection without setting application.properties with the host.
Actual behavior
I need to set the mongodb host on application.properties with no use in my application.
How to Reproduce?
- Create a class that implements MongoCustomizer:
@Override
public MongoClientSettings.Builder customize(MongoClientSettings.Builder builder) {
builder.applyConnectionString(
new com.mongodb.ConnectionString(
"mongodb+srv://hosttt"
)
);
return builder;
}
- dont set mongoclient configuration on application.properties.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment