From aec95c770936c8282f3cbe808baa3ab6a55ff938 Mon Sep 17 00:00:00 2001 From: Matthias Brandt Date: Tue, 23 Jan 2024 16:09:33 +0100 Subject: [PATCH 1/3] acquireOrRefreshLock: Raise loglevel for 'no lock found' to INFO --- .../transactionaloutbox/repository/OutboxLockRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java b/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java index 1bbe5f75..18a12def 100644 --- a/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java +++ b/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java @@ -68,7 +68,7 @@ private boolean acquireOrRefreshLock(String ownerId, Duration timeout, Transacti try { OutboxLock lock = jdbcTemplate.query("select * from outbox_kafka_lock where id = '" + OUTBOX_LOCK_ID + "'", resultSetExtractor); if (lock == null) { - logger.debug("No outbox lock found. Creating one for {}", ownerId); + logger.info("No outbox lock found. Creating one for {}", ownerId); validUntil = now.plus(timeout); jdbcTemplate.update("insert into outbox_kafka_lock (id, owner_id, valid_until) values (?, ?, ?)", OUTBOX_LOCK_ID, ownerId, Timestamp.from(validUntil)); } else if (ownerId.equals(lock.getOwnerId())) { From 546c55f2b9322d8d120d1eb7fd24829d9bcbdd04 Mon Sep 17 00:00:00 2001 From: Matthias Brandt Date: Mon, 11 Dec 2023 11:01:23 +0100 Subject: [PATCH 2/3] acquireOrRefreshLock: Reduce log level for INFO Currently, this message is logged every Duration of `lockTimeout`. In our case, this is every 4 seconds, which is quite much for my taste for an INFO logging... --- .../transactionaloutbox/repository/OutboxLockRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java b/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java index 18a12def..7172bb6e 100644 --- a/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java +++ b/outbox-kafka-spring/src/main/java/one/tomorrow/transactionaloutbox/repository/OutboxLockRepository.java @@ -89,7 +89,7 @@ private boolean acquireOrRefreshLock(String ownerId, Duration timeout, Transacti } txStatus.flush(); - logger.info("Acquired or refreshed outbox lock for owner {}, valid until {}", ownerId, validUntil); + logger.debug("Acquired or refreshed outbox lock for owner {}, valid until {}", ownerId, validUntil); return true; } catch (UncategorizedSQLException e) { return handleException(e, ownerId); From 9ea00bad09bd4c937124c1fe882b2a946f74030e Mon Sep 17 00:00:00 2001 From: Martin Grotzke Date: Mon, 29 Jan 2024 11:38:44 +0100 Subject: [PATCH 3/3] Release outbox-kafka-spring 3.2.2 With the backport of #258 The dependency on the commons module is set to the fixed version, so that there's not the SNAPSHOT dependency. This will be changed back with the push to the next SNAPSHOT version. --- build.gradle.kts | 2 +- outbox-kafka-spring/build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 78f392fa..b9fb581c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent.* import java.util.* project(":commons").version = "2.2.2-SNAPSHOT" -project(":outbox-kafka-spring").version = "3.2.2-SNAPSHOT" +project(":outbox-kafka-spring").version = "3.2.2" project(":outbox-kafka-spring-reactive").version = "3.1.2-SNAPSHOT" plugins { diff --git a/outbox-kafka-spring/build.gradle.kts b/outbox-kafka-spring/build.gradle.kts index b9c02ed3..6b31ed6f 100644 --- a/outbox-kafka-spring/build.gradle.kts +++ b/outbox-kafka-spring/build.gradle.kts @@ -7,13 +7,13 @@ dependencies { val log4jVersion = "2.22.0" val testcontainersVersion = "1.19.3" + implementation("one.tomorrow.transactional-outbox:commons:2.2.1") implementation("org.springframework:spring-context:$springVersion") implementation("org.springframework:spring-jdbc:$springVersion") implementation("org.postgresql:postgresql:42.7.1") implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3") implementation("org.apache.kafka:kafka-clients:$kafkaVersion") "protobufSupportImplementation"("com.google.protobuf:protobuf-java:${rootProject.extra["protobufVersion"]}") - implementation(project(":commons")) implementation("org.slf4j:slf4j-api:2.0.9") implementation("jakarta.annotation:jakarta.annotation-api:2.1.1")