Mendix azure service bus connection

0
Hello,   We have tried to set up an integration between Mendix apps (Mendix private cloud) and the Azure service bus. We have one Azure tenant and in this tenant we have subscriptions per environments (dev,tst,acc and prod). Per subscription we have a Mendix AKS cluster and a Java AKS cluster. Per subscription we also have one instance of the Azure Service Bus installed. We have already set up a working integration between Java apps in the Java Aks cluster and the service bus using the classes of the Azure SDK. Our Java apps are written in Quarkus but we didn’t use any feature from Quarkus to connect to the bus. The connection setup and the sending of the message only used the classes of Azure SDK. We converted the code from this Java project to fit into Mendix Java Actions. The problem occurs at the moment that we call the method sendMessage(ServiceBusMessage message) from the Azure SDK as part of the Mendix Java Action. This method belongs to the ServiceBusSenderClient.class of the Azure SDK. Problem explained in words When the sendMessage method is called a subscriber is created behind the scenes. The subscriber listens for the acknowledgment it should receive from the topic to confirm whether the sending of the message has been correctly executed. The Java thread that is used to create this subscriber waits for some (calculated time based on the AmqpRetryOptions) until all the other parallel threads have finished processing. Unfortunately this does not happen. It seems that the Mendix Java runtime does its own thread management and does not release the parallel threads in time: the countdownLatch should decrease to zero, but this does not happen.   The other solution is to use REST api's to communicate with azure service bus, but creates some overhead, so we would like to use the sdk directly, but for the moment with problems explained in this message.   Any one already succeeded in using the sdk directly?   The exception which is thrown is indicated in the last 3 lines of the code. The exception which is thrown is indicated in red. In the ServiceBusSenderClient.class ------------------------------------------------- public void sendMessage(ServiceBusMessage message) { Objects.requireNonNull(message, "'message' cannot be null."); this.asyncClient.sendMessage(message).block(this.tryTimeout); } Mono.class from Project Reactor -------------------------------------------- @Nullable public T block(Duration timeout) { Context context = ContextPropagationSupport.shouldPropagateContextToThreadLocals() ? ContextPropagation.contextCaptureToEmpty() : Context.empty(); BlockingMonoSubscriber<T> subscriber = new BlockingMonoSubscriber(context); this.subscribe((Subscriber)subscriber); return subscriber.blockingGet(timeout.toNanos(), TimeUnit.NANOSECONDS); } In BlockingSingleSubscriber.class --------------------------------------------- final T blockingGet(long timeout, TimeUnit unit) { if (Schedulers.isInNonBlockingThread()) { throw new IllegalStateException("block()/blockFirst()/blockLast() are blocking, which is not supported in thread " + Thread.currentThread().getName()); } else { RuntimeException re; if (this.getCount() != 0L) { try { if (!this.await(timeout, unit)) { this.dispose(); throw new IllegalStateException("Timeout on blocking read for " + timeout + " " + unit); } } 2025-06-13 07:28:49.506 INFO - Send_Msg_To_ASB_Java_Action: preparing to send the msg to the bus 2025-06-13 07:32:55.583 CRITICAL - Send_Msg_To_ASB_Java_Action: null java.lang.IllegalStateException: Timeout on blocking read for 245600000000 NANOSECONDS       at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:127)       at reactor.core.publisher.Mono.block(Mono.java:1754)       at com.azure.messaging.servicebus.ServiceBusSenderClient.sendMessage(ServiceBusSenderClient.java:266)       at myfirstmodule.actions.JA_SendMessage.sendMessage(JA_SendMessage.java:85)       at myfirstmodule.actions.JA_SendMessage.executeAction(JA_SendMessage.java:55)       at myfirstmodule.actions.JA_SendMessage.executeAction(JA_SendMessage.java:24)       at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:73)       at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)       at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)       at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:66)       at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:122)       at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)       at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:122)       at com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:58)       at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:35)       at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:11)       at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:38)       at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:29)
asked
0 answers