Skip to content

Commit

Permalink
Merge pull request #253 from ravinperera00/java21_2
Browse files Browse the repository at this point in the history
Migrate to new Runtime APIs
  • Loading branch information
warunalakshitha authored Nov 13, 2024
2 parents b614c0a + 35bb9ab commit 260cda7
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 27 deletions.
8 changes: 4 additions & 4 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
org = "ballerina"
name = "mqtt"
version = "1.2.0"
version = "1.2.1"
authors = ["ballerina"]
keywords = ["mqtt", "client", "messaging", "network", "pubsub", "iot"]
repository = "https://github.com/ballerina-platform/module-ballerina-mqtt"
distribution = "2201.10.0-20241007-143200-6b69ca80"
distribution = "2201.11.0-20241112-214900-6b80ab87"

[platform.java21]
graalvmCompatible = true

[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "mqtt-native"
version = "1.2.0"
path = "../native/build/libs/mqtt-native-1.2.0.jar"
version = "1.2.1"
path = "../native/build/libs/mqtt-native-1.2.1-SNAPSHOT.jar"

[[platform.java21.dependency]]
groupId = "org.eclipse.paho"
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "mqtt-compiler-plugin"
class = "io.ballerina.stdlib.mqtt.compiler.MqttCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/mqtt-compiler-plugin-1.2.0.jar"
path = "../compiler-plugin/build/libs/mqtt-compiler-plugin-1.2.1-SNAPSHOT.jar"
16 changes: 8 additions & 8 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.10.0-20241007-143200-6b69ca80"
distribution-version = "2201.11.0-20241112-214900-6b80ab87"

[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.2"
version = "2.7.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -22,7 +22,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -107,7 +107,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.10.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -122,7 +122,7 @@ modules = [
[[package]]
org = "ballerina"
name = "mqtt"
version = "1.2.0"
version = "1.2.1"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -138,7 +138,7 @@ modules = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.3.0"
version = "1.4.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -161,15 +161,15 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "uuid"
version = "1.8.0"
version = "1.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "crypto"},
Expand Down
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "@toml.version@"
authors = ["ballerina"]
keywords = ["mqtt", "client", "messaging", "network", "pubsub", "iot"]
repository = "https://github.com/ballerina-platform/module-ballerina-mqtt"
distribution = "2201.10.0-20241007-143200-6b69ca80"
distribution = "2201.11.0-20241112-214900-6b80ab87"

[platform.java21]
graalvmCompatible = true
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=1.2.1-SNAPSHOT
ballerinaLangVersion=2201.10.0-20241011-152000-627c5bb0
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87

checkstylePluginVersion=10.12.1
spotbugsPluginVersion=6.0.18
Expand All @@ -20,16 +20,16 @@ pahoMqtt5Version=1.2.5
#stdlib dependencies

# Level 01
stdlibTimeVersion=2.5.1-20240930-120200-e59222b
stdlibIoVersion=1.6.2-20240928-084100-656404f
stdlibTimeVersion=2.6.0-20241113-073800-201b904
stdlibIoVersion=1.6.2-20241112-233100-995cf5f

# Level 02
stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4
stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab
stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e
stdlibLogVersion=2.10.1-20241113-120000-4577868
stdlibCryptoVersion=2.7.3-20241113-081400-d015a39
stdlibRandomVersion=1.5.1-20241113-122300-1bc770e

# Level 03
stdlibUuidVersion=1.8.1-20241009-134600-a05012b
stdlibUuidVersion=1.8.1-20241113-154400-443c67b

observeVersion=1.3.1-20241007-161000-645452d
observeInternalVersion=1.3.1-20241007-182700-a5f77a1
observeVersion=1.4.0-20241113-092000-b83ae74
observeInternalVersion=1.3.1-20241113-101700-265054d
8 changes: 8 additions & 0 deletions load-tests/simple_publisher_subscriber/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,11 @@ MQTT Simple Publisher Subscriber,35681,0.10091869049610426,0,0,0,0,0,0,0.0,9.908
MQTT Simple Publisher Subscriber,35683,0.10089293162530127,0,0,0,0,0,0,0.0,9.911497107783779,0,0,1728252848,0,1
MQTT Simple Publisher Subscriber,35680,0.10091786498234255,0,0,0,0,0,0,0.0,9.90904831542927,0,0,1728339211,0,1
MQTT Simple Publisher Subscriber,35702,0.10086237737214643,0,0,0,0,0,0,0.0,9.914499598897558,0,0,1728428180,0,1
MQTT Simple Publisher Subscriber,35697,0.10086120337847378,0,0,0,0,0,0,0.0,9.91461500065172,0,0,1728512013,0,1
MQTT Simple Publisher Subscriber,35698,0.10086439610897274,0,0,0,0,0,0,0.0,9.914301166485064,0,0,1728598505,0,1
MQTT Simple Publisher Subscriber,35649,0.10099239830265372,0,0,0,0,0,0,0.0,9.901735346488188,0,0,1728685351,0,1
MQTT Simple Publisher Subscriber,35711,0.10083494494690563,0,0,0,0,0,0,0.0,9.917196865893539,0,0,1728771169,0,1
MQTT Simple Publisher Subscriber,35697,0.10086273332084827,0,0,0,0,0,0,0.0,9.914464610223888,0,0,1728857674,0,1
MQTT Simple Publisher Subscriber,35688,0.10088545289001598,0,0,0,0,0,0,0.0,9.912231856560997,0,0,1728944015,0,1
MQTT Simple Publisher Subscriber,35695,0.10087680190359725,0,0,0,0,0,0,0.0,9.91308190911572,0,0,1729030357,0,1
MQTT Simple Publisher Subscriber,35682,0.1009024973237017,0,0,0,0,0,0,0.0,9.910557483943492,0,0,1729116898,0,1
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ private void invokeOnMessage(MqttMessage message, String topic) {
message.getProperties().getCorrelationData());
}
try {
Object result = runtime.call(service, MqttConstants.ONMESSAGE, bMqttMessage, callerObject);
Object result = runtime.callMethod(service, MqttConstants.ONMESSAGE, null, bMqttMessage, callerObject);
Util.notifySuccess(result);
} catch (BError bError) {
Util.notifyFailure(bError);
}
} else {
try {
Object result = runtime.call(service, MqttConstants.ONMESSAGE, bMqttMessage);
Object result = runtime.callMethod(service, MqttConstants.ONMESSAGE, null, bMqttMessage);
Util.notifySuccess(result);
} catch (BError bError) {
Util.notifyFailure(bError);
Expand All @@ -131,7 +131,7 @@ private void invokeOnError(BError bError) {
return;
}
try {
Object result = runtime.call(service, MqttConstants.ONERROR, bError);
Object result = runtime.callMethod(service, MqttConstants.ONERROR, null, bError);
Util.notifySuccess(result);
} catch (BError error) {
Util.notifyFailure(error);
Expand All @@ -145,7 +145,7 @@ private void invokeOnComplete(IMqttToken token) {
BMap<BString, Object> bMqttToken;
bMqttToken = getMqttDeliveryToken(token);
try {
Object result = runtime.call(service, MqttConstants.ONCOMPLETE, bMqttToken);
Object result = runtime.callMethod(service, MqttConstants.ONCOMPLETE, null, bMqttToken);
Util.notifySuccess(result);
} catch (BError bError) {
Util.notifyFailure(bError);
Expand Down

0 comments on commit 260cda7

Please sign in to comment.