From b40311f6fbc7ec99fb8b9d6f7dadc230c7a15f1a Mon Sep 17 00:00:00 2001 From: gayaldassanayake Date: Tue, 17 Feb 2026 08:01:14 +0530 Subject: [PATCH 1/4] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 6 +++--- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index a615067c..9b1194b3 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerinax" name = "mssql" -version = "1.16.2" +version = "1.16.3" authors = ["Ballerina"] keywords = ["client", "network", "SQL", "RDBMS", "SQLServer", "MSSQL", "Vendor/Microsoft", "Area/Database", "Type/Connector"] repository = "https://github.com/ballerina-platform/module-ballerinax-mssql" @@ -15,8 +15,8 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "mssql-native" -version = "1.16.2" -path = "../native/build/libs/mssql-native-1.16.2.jar" +version = "1.16.3" +path = "../native/build/libs/mssql-native-1.16.3-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index bcbd6d31..8bfe0411 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "mssql-compiler-plugin" class = "io.ballerina.stdlib.mssql.compiler.MSSQLCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/mssql-compiler-plugin-1.16.2.jar" +path = "../compiler-plugin/build/libs/mssql-compiler-plugin-1.16.3-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 492f3b96..c1ac263f 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -405,7 +405,7 @@ modules = [ [[package]] org = "ballerinax" name = "cdc" -version = "1.0.2" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "data.jsondata"}, From bc13453cd936c29c734437ab6c3f359562bafed8 Mon Sep 17 00:00:00 2001 From: gayaldassanayake Date: Tue, 17 Feb 2026 08:06:06 +0530 Subject: [PATCH 2/4] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 60 ++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index c1ac263f..da3dc620 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -20,6 +20,14 @@ dependencies = [ {org = "ballerina", name = "log"} ] +[[package]] +org = "ballerina" +name = "avro" +version = "1.2.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "cache" @@ -44,7 +52,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.9.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -56,7 +64,7 @@ modules = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -144,7 +152,6 @@ dependencies = [ org = "ballerina" name = "lang.__internal" version = "0.0.0" -scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -182,7 +189,6 @@ dependencies = [ org = "ballerina" name = "lang.int" version = "0.0.0" -scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.__internal"}, @@ -249,7 +255,6 @@ dependencies = [ org = "ballerina" name = "log" version = "2.12.0" -scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -286,7 +291,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -342,7 +347,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -363,7 +368,6 @@ dependencies = [ org = "ballerina" name = "uuid" version = "1.10.0" -scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -409,17 +413,53 @@ version = "1.2.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "data.jsondata"}, + {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerinai", name = "observe"} + {org = "ballerina", name = "log"}, + {org = "ballerinai", name = "observe"}, + {org = "ballerinax", name = "kafka"} ] modules = [ {org = "ballerinax", packageName = "cdc", moduleName = "cdc"} ] +[[package]] +org = "ballerinax" +name = "confluent.cavroserdes" +version = "1.0.2" +dependencies = [ + {org = "ballerina", name = "avro"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerinai", name = "observe"}, + {org = "ballerinax", name = "confluent.cregistry"} +] + +[[package]] +org = "ballerinax" +name = "confluent.cregistry" +version = "0.4.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerinax" +name = "kafka" +version = "4.6.3" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerinai", name = "observe"}, + {org = "ballerinax", name = "confluent.cavroserdes"}, + {org = "ballerinax", name = "confluent.cregistry"} +] + [[package]] org = "ballerinax" name = "mssql" -version = "1.16.2" +version = "1.16.3" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "file"}, From 316b0aebfb1bf8debef0b2b4725f88e9267f3cb5 Mon Sep 17 00:00:00 2001 From: gayaldassanayake Date: Tue, 17 Feb 2026 08:29:48 +0530 Subject: [PATCH 3/4] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index da3dc620..2e8d021e 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -135,7 +135,7 @@ modules = [ [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, @@ -265,7 +265,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -299,7 +299,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -358,7 +358,7 @@ modules = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} From ad4d9d6151ff6e2af1f66bd71bf7eefcca72aad5 Mon Sep 17 00:00:00 2001 From: gayaldassanayake Date: Tue, 17 Feb 2026 08:36:56 +0530 Subject: [PATCH 4/4] Bump dependency versions --- ballerina/cdc_listener.bal | 16 +-- ballerina/tests/listener_liveness_test.bal | 107 +++++++++++++++++++++ build.gradle | 4 + gradle.properties | 15 +-- 4 files changed, 130 insertions(+), 12 deletions(-) create mode 100644 ballerina/tests/listener_liveness_test.bal diff --git a/ballerina/cdc_listener.bal b/ballerina/cdc_listener.bal index ee2dd538..cfcc5be6 100644 --- a/ballerina/cdc_listener.bal +++ b/ballerina/cdc_listener.bal @@ -19,7 +19,7 @@ import ballerinax/cdc; public isolated class CdcListener { *cdc:Listener; - private final map & readonly config; + private final map & readonly config; private boolean isStarted = false; private boolean hasAttachedService = false; @@ -27,13 +27,13 @@ public isolated class CdcListener { # # + config - The configuration for the MSSQL connector public isolated function init(*MsSqlListenerConfiguration config) { - map configMap = {}; + map debeziumConfigs = {}; cdc:populateDebeziumProperties({ engineName: config.engineName, offsetStorage: config.offsetStorage, internalSchemaStorage: config.internalSchemaStorage, options: config.options - }, configMap); + }, debeziumConfigs); cdc:populateDatabaseConfigurations({ connectorClass: config.database.connectorClass, hostname: config.database.hostname, @@ -47,9 +47,13 @@ public isolated class CdcListener { excludedTables: config.database.excludedTables, includedColumns: config.database.includedColumns, excludedColumns: config.database.excludedColumns - }, configMap); - populateMsSqlConfigurations(config.database, configMap); - self.config = configMap.cloneReadOnly(); + }, debeziumConfigs); + populateMsSqlConfigurations(config.database, debeziumConfigs); + map listenerConfigs = { + ...debeziumConfigs + }; + listenerConfigs["livenessInterval"] = config.livenessInterval; + self.config = listenerConfigs.cloneReadOnly(); } # Attaches a CDC service to the MSSQL listener. diff --git a/ballerina/tests/listener_liveness_test.bal b/ballerina/tests/listener_liveness_test.bal new file mode 100644 index 00000000..84e651bf --- /dev/null +++ b/ballerina/tests/listener_liveness_test.bal @@ -0,0 +1,107 @@ +// Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/lang.runtime; +import ballerina/test; +import ballerinax/cdc; + +@test:Config { + groups: ["liveness"] +} +function testLivenessBeforeListenerStart() returns error? { + CdcListener mssqlListener = new ({ + database: { + username: cdcUsername, + password: cdcPassword, + port: cdcPort, + databaseNames: cdcDatabase + }, + options: { + snapshotMode: cdc:NO_DATA + } + }); + check mssqlListener.attach(testService); + boolean liveness = check cdc:isLive(mssqlListener); + test:assertFalse(liveness, "Liveness check passes even before listener starts"); +} + +@test:Config { + groups: ["liveness"] +} +function testLivenessWithStartedListener() returns error? { + CdcListener mssqlListener = new ({ + database: { + username: cdcUsername, + password: cdcPassword, + port: cdcPort, + databaseNames: cdcDatabase + }, + options: { + snapshotMode: cdc:NO_DATA + } + }); + check mssqlListener.attach(testService); + check mssqlListener.'start(); + boolean liveness = check cdc:isLive(mssqlListener); + test:assertTrue(liveness, "Liveness fails for a started listener"); + check mssqlListener.gracefulStop(); +} + +@test:Config { + groups: ["liveness"] +} +function testLivenessAfterListenerStop() returns error? { + CdcListener mssqlListener = new ({ + database: { + username: cdcUsername, + password: cdcPassword, + port: cdcPort, + databaseNames: cdcDatabase + }, + options: { + snapshotMode: cdc:NO_DATA + } + }); + check mssqlListener.attach(testService); + check mssqlListener.'start(); + check mssqlListener.gracefulStop(); + boolean liveness = check cdc:isLive(mssqlListener); + test:assertFalse(liveness, "Liveness check passes after the listener has stopped"); +} + +@test:Config { + groups: ["liveness"] +} +function testLivenessWithoutReceivingEvents() returns error? { + CdcListener mssqlListener = new ({ + database: { + username: cdcUsername, + password: cdcPassword, + port: cdcPort, + databaseNames: cdcDatabase + }, + options: { + snapshotMode: cdc:NO_DATA + }, + livenessInterval: 5.0 + }); + check mssqlListener.attach(testService); + check mssqlListener.'start(); + runtime:sleep(10); + boolean liveness = check cdc:isLive(mssqlListener); + test:assertFalse(liveness, "Liveness check passes even after not receiving events within the liveness interval"); + check mssqlListener.gracefulStop(); +} diff --git a/build.gradle b/build.gradle index 32f18830..90d77986 100644 --- a/build.gradle +++ b/build.gradle @@ -99,9 +99,13 @@ subprojects { ballerinaStdLibs "io.ballerina.stdlib:observe-ballerina:${observeVersion}" ballerinaStdLibs "io.ballerina:observe-ballerina:${observeInternalVersion}" ballerinaStdLibs "io.ballerina.stdlib:mssql.driver-ballerina:${stdlibMssqlDriverVersion}" + ballerinaStdLibs "io.ballerina.lib:avro-ballerina:${stdlibAvroVersion}" ballerinaStdLibs "io.ballerina.lib:cdc-ballerina:${stdlibCdcVersion}" ballerinaStdLibs "io.ballerina.lib:mssql.cdc.driver-ballerina:${stdlibMSSQLCdcDriverVersion}" + ballerinaStdLibs "io.ballerina.stdlib:kafka-ballerina:${stdlibKafkaVersion}" + ballerinaStdLibs "io.ballerina.lib:confluent.cavroserdes-ballerina:${stdlibConfluentAvroSerDesVersion}" + ballerinaStdLibs "io.ballerina.lib:confluent.cregistry-ballerina:${stdlibConfluentSchemaRegistryVersion}" } } diff --git a/gradle.properties b/gradle.properties index cda1230d..a71b94eb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ stdlibSqlVersion=1.16.0 # Direct Dependencies # Level 01 stdlibIoVersion=1.8.0 -stdlibTimeVersion=2.7.0 +stdlibTimeVersion=2.8.0 # Level 02 stdlibLogVersion=2.12.0 @@ -27,10 +27,10 @@ stdlibOsVersion=1.10.0 stdlibFileVersion=1.12.0 # Ballerinax Observer -observeVersion=1.5.0 +observeVersion=1.5.1 observeInternalVersion=1.5.0 -stdlibCdcVersion=1.0.2 +stdlibCdcVersion=1.2.0-20260213-180200-2268a4d stdlibMSSQLCdcDriverVersion=1.0.0 # Transitive Dependencies @@ -39,8 +39,9 @@ stdlibConstraintVersion=1.7.0 stdlibUrlVersion=2.6.0 # Level 02 -stdlibCryptoVersion=2.9.0 +stdlibCryptoVersion=2.9.3 stdlibTaskVersion=2.7.0 +stdlibAvroVersion=1.2.0 # Level 03 stdlibCacheVersion=3.10.0 @@ -48,7 +49,7 @@ stdlibMimeVersion=2.12.0 stdlibUuidVersion=1.10.0 # Level 04 -stdlibDataJsonDataVersion=1.1.0 +stdlibDataJsonDataVersion=1.1.3 stdlibAuthVersion=2.14.0 stdlibJwtVersion=2.15.0 stdlibOAuth2Version=2.14.0 @@ -61,4 +62,6 @@ stdlibTransactionVersion=1.12.0 # Ballerina library stdlibMssqlDriverVersion=1.7.0 - +stdlibConfluentAvroSerDesVersion=1.0.2 +stdlibConfluentSchemaRegistryVersion=0.4.3 +stdlibKafkaVersion=4.6.3