use of io.micronaut.configuration.mongo.core.DefaultMongoConfiguration in project micronaut-mongodb by micronaut-projects.
the class MongoProcessFactory method onCreated.
@Override
public DefaultMongoConfiguration onCreated(BeanCreatedEvent<DefaultMongoConfiguration> event) {
DefaultMongoConfiguration configuration = event.getBean();
try {
Optional<ConnectionString> connectionString = configuration.getConnectionString();
startEmbeddedMongoIfPossible(connectionString.orElse(null), null);
} catch (IOException e) {
throw new ConfigurationException("Error starting Embedded MongoDB server: " + e.getMessage(), e);
}
return configuration;
}
Aggregations