diff --git a/gradle.properties b/gradle.properties index 3aa55fa..08c29c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ org.gradle.caching=true group=io.ballerina version=1.3.1-SNAPSHOT -ballerinaLangVersion=2201.10.0-20241011-161100-51978649 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 githubSpotbugsVersion=6.0.18 githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=5.4.0 @@ -28,7 +28,7 @@ openTelemetryVersion=1.7.0 nettyCodecVersion=4.1.100.Final gsonVersion=2.10.1 -observeVersion=1.3.1-20241007-161000-645452d +observeVersion=1.4.0-20241113-092000-b83ae74 # Test Dependency Versions testngVersion=7.6.1 diff --git a/testobserve/native/src/main/java/org/ballerina/testobserve/listenerendpoint/WebServer.java b/testobserve/native/src/main/java/org/ballerina/testobserve/listenerendpoint/WebServer.java index 8c36ef5..ab2e209 100644 --- a/testobserve/native/src/main/java/org/ballerina/testobserve/listenerendpoint/WebServer.java +++ b/testobserve/native/src/main/java/org/ballerina/testobserve/listenerendpoint/WebServer.java @@ -19,7 +19,7 @@ package org.ballerina.testobserve.listenerendpoint; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.async.StrandMetadata; +import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ObjectType; @@ -243,22 +243,12 @@ protected void channelRead0(ChannelHandlerContext ctx, Object o) { Map properties = new HashMap<>(); properties.put(ObservabilityConstants.KEY_OBSERVER_CONTEXT, observerContext); - - StrandMetadata strandMetadata = new StrandMetadata(TEST_OBSERVE_PACKAGE.getOrg(), - TEST_OBSERVE_PACKAGE.getName(), TEST_OBSERVE_PACKAGE.getMajorVersion(), - resourceFunctionName); Utils.logInfo("Dispatching resource " + resourcePath); ObjectType objectType = (ObjectType) serviceObject.getOriginalType(); - Object result; - try { - if (objectType.isIsolated() && objectType.isIsolated(resourceFunctionName)) { - result = env.getRuntime().startIsolatedWorker(serviceObject, resourceFunctionName, null, - strandMetadata, properties, args).get(); - } else { - result = env.getRuntime().startNonIsolatedWorker(serviceObject, resourceFunctionName, null, - strandMetadata, properties, args).get(); - } + boolean isConcurrentSafe = objectType.isIsolated() && objectType.isIsolated(resourceFunctionName); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, properties); + Object result = env.getRuntime().callMethod(serviceObject, resourceFunctionName, metadata, args); handleResult(ctx, result, resourcePath); } catch (BError error) { handleError(ctx, error, resourcePath);