summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java
diff options
context:
space:
mode:
authorsourabh_sourabh <sourabh.sourabh@est.tech>2022-07-07 16:53:45 +0100
committersourabh_sourabh <sourabh.sourabh@est.tech>2022-07-25 13:45:44 +0100
commit054873c7c52bdb9fae718a0d7651d57b1a995dfc (patch)
tree1dd91a2a83144d4ed07b18f12b1973cb8dc35337 /cps-service/src/main/java
parent9fdaf6c0f472cad13ade1469458822d468fd2d6d (diff)
CmHandle creation performance degradation
- Created a dedicated threadpool for scheduler. - Tuned async threadpool of notification executor from setting RejectedExecutionHandler and application.yml. Issue-ID: CPS-1126 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I2afe3c76c1aec78751777df0d2f08ddb8dcee102
Diffstat (limited to 'cps-service/src/main/java')
-rw-r--r--cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java b/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java
index 2d8f7fb08b..9327c53451 100644
--- a/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java
+++ b/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java
@@ -21,6 +21,7 @@
package org.onap.cps.config;
+import java.util.concurrent.ThreadPoolExecutor;
import javax.validation.constraints.Min;
import lombok.Setter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -61,7 +62,10 @@ public class AsyncConfig {
executor.setMaxPoolSize(maxPoolSize);
executor.setQueueCapacity(queueCapacity);
executor.setWaitForTasksToCompleteOnShutdown(waitForTasksToCompleteOnShutdown);
+ executor.setKeepAliveSeconds(60);
executor.setThreadNamePrefix(threadNamePrefix);
+ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
+ executor.initialize();
return executor;
}