All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mongock.driver.mongodb.springdata.v4.config.SpringDataMongoV4Context Maven / Gradle / Ivy

The newest version!
package io.mongock.driver.mongodb.springdata.v4.config;

import io.mongock.api.config.*;
import io.mongock.driver.mongodb.springdata.v4.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.boot.autoconfigure.condition.*;
import org.springframework.boot.context.properties.*;
import org.springframework.data.mongodb.core.*;

@AutoConfiguration
@ConditionalOnExpression("${mongock.enabled:true}")
@ConditionalOnBean(MongockConfiguration.class)
@EnableConfigurationProperties(MongoDBConfiguration.class)
public class SpringDataMongoV4Context extends SpringDataMongoV4ContextBase {

  @Override
  protected SpringDataMongoV4Driver buildDriver(MongoTemplate mongoTemplate,
                                                MongockConfiguration config,
                                                MongoDBConfiguration mongoDbConfig) {
    return SpringDataMongoV4Driver.withLockStrategy(
        mongoTemplate,
        config.getLockAcquiredForMillis(),
        config.getLockQuitTryingAfterMillis(),
        config.getLockTryFrequencyMillis());
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy