Class AbstractReactiveMongoConfiguration
java.lang.Object
org.springframework.data.mongodb.config.MongoConfigurationSupport
org.springframework.data.mongodb.config.AbstractReactiveMongoConfiguration
@Configuration(proxyBeanMethods=false)
public abstract class AbstractReactiveMongoConfiguration
extends MongoConfigurationSupport
Base class for reactive Spring Data MongoDB configuration using JavaConfig.
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.reactivestreams.client.MongoClient
createReactiveMongoClient
(com.mongodb.MongoClientSettings settings) Create the Reactive StreamsMongoClient
instance with givenMongoClientSettings
.mappingMongoConverter
(ReactiveMongoDatabaseFactory databaseFactory, MongoCustomConversions customConversions, MongoMappingContext mappingContext) com.mongodb.reactivestreams.client.MongoClient
Return the Reactive StreamsMongoClient
instance to connect to.Creates aReactiveMongoDatabaseFactory
to be used by theReactiveMongoOperations
.reactiveMongoTemplate
(ReactiveMongoDatabaseFactory databaseFactory, MappingMongoConverter mongoConverter) CreatesReactiveMongoOperations
.Methods inherited from class org.springframework.data.mongodb.config.MongoConfigurationSupport
abbreviateFieldNames, autoIndexCreation, configureClientSettings, configureConverters, customConversions, fieldNamingStrategy, getDatabaseName, getInitialEntitySet, getMappingBasePackages, mongoClientSettings, mongoManagedTypes, mongoMappingContext, scanForEntities
-
Constructor Details
-
AbstractReactiveMongoConfiguration
public AbstractReactiveMongoConfiguration()
-
-
Method Details
-
reactiveMongoClient
public com.mongodb.reactivestreams.client.MongoClient reactiveMongoClient()Return the Reactive StreamsMongoClient
instance to connect to. Annotate withBean
in case you want to expose aMongoClient
instance to theApplicationContext
.
OverrideMongoConfigurationSupport.mongoClientSettings()
to configure connection details.- Returns:
- never null.
- See Also:
-
reactiveMongoTemplate
@Bean public ReactiveMongoTemplate reactiveMongoTemplate(ReactiveMongoDatabaseFactory databaseFactory, MappingMongoConverter mongoConverter) CreatesReactiveMongoOperations
.- Returns:
- never null.
- See Also:
-
reactiveMongoDbFactory
Creates aReactiveMongoDatabaseFactory
to be used by theReactiveMongoOperations
. Will use theMongoClient
instance configured inreactiveMongoClient()
.- Returns:
- never null.
- See Also:
-
mappingMongoConverter
@Bean public MappingMongoConverter mappingMongoConverter(ReactiveMongoDatabaseFactory databaseFactory, MongoCustomConversions customConversions, MongoMappingContext mappingContext) Creates aMappingMongoConverter
using the configuredreactiveMongoDbFactory()
andMongoConfigurationSupport.mongoMappingContext(MongoCustomConversions, org.springframework.data.mongodb.MongoManagedTypes)
. Will getMongoConfigurationSupport.customConversions()
applied. -
createReactiveMongoClient
protected com.mongodb.reactivestreams.client.MongoClient createReactiveMongoClient(com.mongodb.MongoClientSettings settings) Create the Reactive StreamsMongoClient
instance with givenMongoClientSettings
.- Returns:
- never null.
- Since:
- 3.0
-