From 69f7915d7dfa5c22e16f593ea9760c378bfd7cd6 Mon Sep 17 00:00:00 2001 From: Anover000 <140409886+Anover000@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:44:12 +0530 Subject: [PATCH] [PHEE-560] Reduce Memory Consumption of reported services (#18) * zeebe max-exe-trds 1000->50 * zeebe client version 8.1.1 -> 8.1.23 * zeebe poll Interval 1 -> 10, configurable --- build.gradle | 2 +- .../connector/mojaloop/zeebe/ZeebeClientConfiguration.java | 5 ++++- src/main/resources/application.yml | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 4c9832f..be6434a 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ repositories { ext { camelVersion = '3.18.1' - zeebClientVersion = '8.1.1' + zeebClientVersion = '8.1.23' springBootVersion = '2.7.3' } diff --git a/src/main/java/org/mifos/connector/mojaloop/zeebe/ZeebeClientConfiguration.java b/src/main/java/org/mifos/connector/mojaloop/zeebe/ZeebeClientConfiguration.java index 308b7ce..9dffbce 100644 --- a/src/main/java/org/mifos/connector/mojaloop/zeebe/ZeebeClientConfiguration.java +++ b/src/main/java/org/mifos/connector/mojaloop/zeebe/ZeebeClientConfiguration.java @@ -18,12 +18,15 @@ public class ZeebeClientConfiguration { @Value("${zeebe.client.max-execution-threads}") private int zeebeClientMaxThreads; + @Value("${zeebe.client.poll-interval}") + private int zeebeClientPollInterval; + @Bean public ZeebeClient setup() { return ZeebeClient.newClientBuilder() .gatewayAddress(zeebeBrokerContactpoint) .usePlaintext() - .defaultJobPollInterval(Duration.ofMillis(1)) + .defaultJobPollInterval(Duration.ofMillis(zeebeClientPollInterval)) .defaultJobWorkerMaxJobsActive(2000) .numJobWorkerExecutionThreads(zeebeClientMaxThreads) .build(); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 8b2b469..6c0629b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,8 +14,9 @@ bpmn: zeebe: client: - max-execution-threads: 1000 + max-execution-threads: 50 evenly-allocated-max-jobs: 1000 + poll-interval: 10 # max-execution-threads: 100 # number-of-workers: 15 # evenly-allocated-max-jobs: "#{${zeebe.client.max-execution-threads} / ${zeebe.client.number-of-workers}}"