From cd048075b11eef88501619da0068d5eb6dd330f7 Mon Sep 17 00:00:00 2001 From: Renu Kumari Date: Thu, 2 Sep 2021 10:30:09 -0400 Subject: Add property to enable Notification Sevice async processing - made notification service synchronous by default - added new property to enable async processing if required Issue-ID: CPS-630 Signed-off-by: Renu Kumari Change-Id: I28c2c98d7a79219a5932732d2940f5ac37bf1653 --- cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cps-service/src/main/java/org/onap') 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 4c961598e..2667ef490 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 @@ -22,6 +22,7 @@ package org.onap.cps.config; import javax.validation.constraints.Min; import lombok.Setter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -32,7 +33,8 @@ import org.springframework.validation.annotation.Validated; @EnableAsync @Configuration -@ConfigurationProperties("notification.async-executor") +@ConditionalOnProperty(name = "notification.async.enabled", havingValue = "true", matchIfMissing = false) +@ConfigurationProperties("notification.async.executor") @Validated @Setter public class AsyncConfig { -- cgit 1.2.3-korg