Search in sources :

Example 1 with ReactiveMongoClientFactory

use of org.springframework.boot.autoconfigure.mongo.ReactiveMongoClientFactory in project scaffold-clean-architecture by bancolombia.

the class MongoConfig method mongoProperties.

@Bean
public ReactiveMongoClientFactory mongoProperties(MongoDBSecret secret, Environment env) {
    MongoProperties properties = new MongoProperties();
    properties.setUri(secret.getUri());
    List<MongoClientSettingsBuilderCustomizer> list = new ArrayList<>();
    list.add(new MongoPropertiesClientSettingsBuilderCustomizer(properties, env));
    return new ReactiveMongoClientFactory(list);
}
Also used : MongoClientSettingsBuilderCustomizer(org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer) ReactiveMongoClientFactory(org.springframework.boot.autoconfigure.mongo.ReactiveMongoClientFactory) ArrayList(java.util.ArrayList) MongoPropertiesClientSettingsBuilderCustomizer(org.springframework.boot.autoconfigure.mongo.MongoPropertiesClientSettingsBuilderCustomizer) MongoProperties(org.springframework.boot.autoconfigure.mongo.MongoProperties) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArrayList (java.util.ArrayList)1 MongoClientSettingsBuilderCustomizer (org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer)1 MongoProperties (org.springframework.boot.autoconfigure.mongo.MongoProperties)1 MongoPropertiesClientSettingsBuilderCustomizer (org.springframework.boot.autoconfigure.mongo.MongoPropertiesClientSettingsBuilderCustomizer)1 ReactiveMongoClientFactory (org.springframework.boot.autoconfigure.mongo.ReactiveMongoClientFactory)1 Bean (org.springframework.context.annotation.Bean)1