utkarsh dubey
utkarsh dubey

Reputation: 875

How can i configure specific connection pool implementation with spring-boot & spring-data-mongodb?

I am using spring-boot along with spring-data-mongodb. But I have to configure a separate connection pool. Is it Possible?

Upvotes: 1

Views: 2461

Answers (1)

s7vr
s7vr

Reputation: 76004

Here all the properties that you can currently configure for mongodb in spring boot.

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.

You can configure the connection pool properties by autowiring MongoClientOptionsFactoryBean.

http://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/MongoClientOptionsFactoryBean.html

Upvotes: 3

Related Questions