1
我正在使用spring-boot和spring-data-mongodb。 但我必須配置一個單獨的連接池。可能嗎?如何使用spring-boot和spring-data-mongodb配置特定的連接池實現?
我正在使用spring-boot和spring-data-mongodb。 但我必須配置一個單獨的連接池。可能嗎?如何使用spring-boot和spring-data-mongodb配置特定的連接池實現?
這裏列出了當前可以在spring引導中爲mongodb配置的所有屬性。
https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
spring.data.mongodb.authentication-database= # Authentication database name.
spring.data.mongodb.database=test # Database name.
spring.data.mongodb.field-naming-strategy= # Fully qualified name of the FieldNamingStrategy to use.
spring.data.mongodb.grid-fs-database= # GridFS database name.
spring.data.mongodb.host=localhost # Mongo server host.
spring.data.mongodb.password= # Login password of the mongo server.
spring.data.mongodb.port=27017 # Mongo server port.
spring.data.mongodb.repositories.enabled=true # Enable Mongo repositories.
spring.data.mongodb.uri=mongodb://localhost/test # Mongo database URI. When set, host and port are ignored.
spring.data.mongodb.username= # Login user of the mongo server.
您可以通過自動裝配MongoClientOptionsFactoryBean配置連接池屬性。
什麼是特定連接池?你正在尋找什麼屬性? – Veeram