From 4ae431920de0dc525644874664b1750f499f8d03 Mon Sep 17 00:00:00 2001 From: codybum Date: Thu, 13 Jun 2024 16:19:57 -0400 Subject: [PATCH] flow control settings --- .../cresco/agent/controller/communication/ActiveBroker.java | 3 ++- .../cresco/agent/controller/communication/ActiveClient.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/cresco/agent/controller/communication/ActiveBroker.java b/src/main/java/io/cresco/agent/controller/communication/ActiveBroker.java index b1227b8..07a14ae 100644 --- a/src/main/java/io/cresco/agent/controller/communication/ActiveBroker.java +++ b/src/main/java/io/cresco/agent/controller/communication/ActiveBroker.java @@ -87,11 +87,12 @@ public ActiveBroker(ControllerEngine controllerEngine, String brokerName) { entry.setQueue(">"); //enable prioritization of messages in queues entry.setPrioritizedMessages(true); - //entry.setProducerFlowControl(true); + entry.setProducerFlowControl(true); entry.setTopic(">"); //enable prioritization of messages in queues entry.setPrioritizedMessages(true); + entry.setProducerFlowControl(true); //configure prefetch rate ratio to prevent exhaustion of resources from slow consumers int topicPrefetchLimit = plugin.getConfig().getIntegerParam("topic_prefetch_limit",1000); entry.setTopicPrefetch(topicPrefetchLimit); diff --git a/src/main/java/io/cresco/agent/controller/communication/ActiveClient.java b/src/main/java/io/cresco/agent/controller/communication/ActiveClient.java index 23cdd3c..a259eb2 100644 --- a/src/main/java/io/cresco/agent/controller/communication/ActiveClient.java +++ b/src/main/java/io/cresco/agent/controller/communication/ActiveClient.java @@ -198,6 +198,10 @@ private ActiveMQSslConnectionFactory initConnectionFactory(String URI) { try { activeMQSslConnectionFactory = new ActiveMQSslConnectionFactory(URI); + //activeMQSslConnectionFactory.setAlwaysSessionAsync(false); + //activeMQSslConnectionFactory.setOptimizeAcknowledge(true); + //activeMQSslConnectionFactory.setUseAsyncSend(true); + if(URI.startsWith("vm://")) { activeMQSslConnectionFactory.setObjectMessageSerializationDefered(true); }