Skip to content

Commit

Permalink
feat: Bump Mongo driver and Spring Boot versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-gryzbon committed Sep 18, 2024
1 parent 796e1bb commit 93ef645
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
dependencies {
// Mongo
api 'org.litote.kmongo:kmongo:5.1.0'
api('org.litote.kmongo:kmongo:5.1.0') {
exclude group: "org.mongodb", module: "mongodb-driver-sync"
exclude group: "org.mongodb", module: "mongodb-driver-core"
}
api 'org.mongodb:mongodb-driver-core:5.1.4'
api 'org.mongodb:mongodb-driver-sync:5.1.4'

// LSD
api 'io.github.lsd-consulting:lsd-distributed-connector:2.0.8'
implementation 'io.github.lsd-consulting:lsd-logging-library:1.0.14'

// Spring
compileOnly 'org.springframework.boot:spring-boot-autoconfigure:3.2.5'
compileOnly 'org.springframework.boot:spring-boot-autoconfigure:3.3.3'

// Other
implementation 'org.apache.httpcomponents:httpcore:4.4.16' // Needed for DB connection security
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ open class LibraryConfig {
@Value("\${lsd.dist.connectionString}") dbConnectionString: String,
@Value("\${lsd.dist.db.trustStoreLocation:#{null}}") trustStoreLocation: String?,
@Value("\${lsd.dist.db.trustStorePassword:#{null}}") trustStorePassword: String?,
@Value("\${lsd.dist.db.connectionTimeout.millis:#{" + DEFAULT_TIMEOUT_MILLIS + "}}") connectionTimeout: Int,
@Value("\${lsd.dist.db.connectionTimeout.millis:#{" + DEFAULT_TIMEOUT_MILLIS + "}}") connectionTimeout: Long,
@Value("\${lsd.dist.db.collectionSizeLimit.megabytes:#{" + DEFAULT_COLLECTION_SIZE_LIMIT_MBS + "}}") collectionSizeLimit: Long,
): InterceptedInteractionCollectionBuilder = InterceptedInteractionCollectionBuilder(
dbConnectionString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const val DEFAULT_COLLECTION_SIZE_LIMIT_MBS = 1000 * 10L // 10Gb

class InterceptedInteractionCollectionBuilder(
private val dbConnectionString: String, private val trustStoreLocation: String?,
private val trustStorePassword: String?, private val connectionTimeout: Int,
private val trustStorePassword: String?, private val connectionTimeout: Long,
private val collectionSizeLimit: Long
) {
val pojoCodecRegistry: CodecRegistry = CodecRegistries.fromRegistries(
Expand All @@ -45,7 +45,7 @@ class InterceptedInteractionCollectionBuilder(
b.readTimeout(connectionTimeout, MILLISECONDS)
}
.applyToClusterSettings { b: ClusterSettings.Builder ->
b.serverSelectionTimeout(connectionTimeout.toLong(), MILLISECONDS)
b.serverSelectionTimeout(connectionTimeout, MILLISECONDS)
}
.applyConnectionString(ConnectionString(dbConnectionString))
if (!trustStoreLocation.isNullOrBlank() && !trustStorePassword.isNullOrBlank()) {
Expand Down Expand Up @@ -112,7 +112,7 @@ class InterceptedInteractionCollectionBuilder(
}

constructor(
dbConnectionString: String, connectionTimeout: Int,
dbConnectionString: String, connectionTimeout: Long,
collectionSizeLimit: Long
) : this(dbConnectionString, null, null, connectionTimeout, collectionSizeLimit)
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ internal class InterceptedDocumentMongoRepositoryResiliencyIT {
}

companion object {
private const val DB_CONNECTION_TIMEOUT = 500
private const val DB_CONNECTION_TIMEOUT = 500L
const val DB_COLLECTION_SIZE_LIMIT = 1024 * 100L

@JvmStatic
Expand Down

0 comments on commit 93ef645

Please sign in to comment.