diff --git a/native/src/main/java/org/ballerinax/asb/sender/MessageSender.java b/native/src/main/java/org/ballerinax/asb/sender/MessageSender.java index 131300fc..2dbe4163 100644 --- a/native/src/main/java/org/ballerinax/asb/sender/MessageSender.java +++ b/native/src/main/java/org/ballerinax/asb/sender/MessageSender.java @@ -105,7 +105,7 @@ public static Object initializeSender(BObject senderClient, String connectionStr * @return An error if failed to send the message */ public static Object send(Environment env, BObject senderClient, BMap message) { - ServiceBusSenderClient sender = getSenderFromBObject(senderClient); + ServiceBusSenderClient sender = getNativeSender(senderClient); Future future = env.markAsync(); EXECUTOR_SERVICE.execute(() -> { try { @@ -136,7 +136,7 @@ public static Object send(Environment env, BObject senderClient, BMap message, BMap scheduleTime) { - ServiceBusSenderClient sender = getSenderFromBObject(senderClient); + ServiceBusSenderClient sender = getNativeSender(senderClient); Future future = env.markAsync(); EXECUTOR_SERVICE.execute(() -> { try { @@ -164,7 +164,7 @@ public static Object schedule(Environment env, BObject senderClient, BMap { try { @@ -193,7 +193,7 @@ public static Object cancel(Environment env, BObject senderClient, long sequence * @return An error if failed send the message. */ public static Object sendBatch(Environment env, BObject senderClient, BMap messages) { - ServiceBusSenderClient sender = getSenderFromBObject(senderClient); + ServiceBusSenderClient sender = getNativeSender(senderClient); Future future = env.markAsync(); EXECUTOR_SERVICE.execute(() -> { try { @@ -245,7 +245,7 @@ public static Object sendBatch(Environment env, BObject senderClient, BMap { try { @@ -363,7 +363,7 @@ private static void setClient(BObject senderObject, ServiceBusSenderClient clien senderObject.addNativeData(ASBConstants.SENDER_CLIENT, client); } - private static ServiceBusSenderClient getSenderFromBObject(BObject senderObject) { + private static ServiceBusSenderClient getNativeSender(BObject senderObject) { return (ServiceBusSenderClient) senderObject.getNativeData(ASBConstants.SENDER_CLIENT); } }