Package io.quarkus.mongodb.runtime
Class MongodbConfig
- java.lang.Object
-
- io.quarkus.mongodb.runtime.MongodbConfig
-
@ConfigRoot(name="mongodb", phase=RUN_TIME) public class MongodbConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_NAME
MongoClientConfig
defaultMongoClientConfig
The default mongo client connection.Map<String,MongoClientConfig>
mongoClientConfigs
Configures additional mongo client connections.
-
Constructor Summary
Constructors Constructor Description MongodbConfig()
-
-
-
Field Detail
-
CONFIG_NAME
public static final String CONFIG_NAME
- See Also:
- Constant Field Values
-
defaultMongoClientConfig
@ConfigItem(name="<<parent>>") public MongoClientConfig defaultMongoClientConfig
The default mongo client connection.
-
mongoClientConfigs
@ConfigItem(name="<<parent>>") public Map<String,MongoClientConfig> mongoClientConfigs
Configures additional mongo client connections.each cluster have a unique identifier witch must be identified to select the right connection. example:
quarkus.mongodb.cluster1.connection-string = mongodb://mongo1:27017 quarkus.mongodb.cluster2.connection-string = mongodb://mongo2:27017,mongodb://mongo3:27017
And then use annotations above the instances of MongoClient to indicate which instance we are going to use
@MongoClientName("cluster1") @Inject ReactiveMongoClient mongoClientCluster1
-
-