From 98765f3075ee188d17903aff6dce2702844b3031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristo=20Kuusk=C3=BCll?= Date: Mon, 28 Oct 2024 13:57:38 +0200 Subject: [PATCH] Deferred messages are enabled by default. (#94) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- .../com/transferwise/kafka/tkms/config/TkmsProperties.java | 4 +--- .../java/com/transferwise/kafka/tkms/dao/TkmsMariaDao.java | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c766f42..a268228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.33.0] - 2024-10-28 + +### Changed + +- Messages are now deferred up to pre-commit hook by default. + This allows better database resource usage in most cases. + ## [0.32.0] - 2024-10-11 ### Added - Added a postprocessor to the `TkmsKafkaProducerProvider` to allow features like tracing attached to the Kafka Producer. diff --git a/gradle.properties b/gradle.properties index a730574..47feb6e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.32.0 +version=0.33.0 diff --git a/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/config/TkmsProperties.java b/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/config/TkmsProperties.java index a2c7468..67aa026 100644 --- a/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/config/TkmsProperties.java +++ b/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/config/TkmsProperties.java @@ -233,10 +233,8 @@ public void afterPropertiesSet() { * *

The tradeoff is that higher application memory is required for transactions sending out huge number or/and huge messages. * However, in practical applications, large transactions should be avoided anyway. - * - *

May default to true for Postgres in upcoming versions. Or even default to true in all situations. */ - private boolean deferMessageRegistrationUntilCommit = false; + private boolean deferMessageRegistrationUntilCommit = true; @Valid @jakarta.validation.Valid diff --git a/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/dao/TkmsMariaDao.java b/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/dao/TkmsMariaDao.java index 9a4dbe6..2379fb1 100644 --- a/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/dao/TkmsMariaDao.java +++ b/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/dao/TkmsMariaDao.java @@ -52,7 +52,7 @@ public void validateDatabase() { boolean engineIndependentStatsEnabled = isEngineIndependentStatsEnabled(); if (!engineIndependentStatsEnabled) { problemNotifier.notify(null, NotificationType.ENGINE_INDEPENDENT_STATS_NOT_ENABLED, NotificationLevel.WARN, () -> - "Engine independent statics are not enabled."); + "Engine independent statistics are not enabled."); } } catch (DataAccessException dae) { problemNotifier.notify(null, NotificationType.TABLE_INDEX_STATS_CHECK_ERROR, NotificationLevel.ERROR, () ->