From ce3730c7286f03375f38215a50af1ae6530a4845 Mon Sep 17 00:00:00 2001 From: grabinsk Date: Tue, 2 Jul 2019 16:05:24 +0200 Subject: fix CbsConfiguration update bug 'CbsConfiguration' bean is statefull. The singleton instance lifespan should match application lifespan. The problem was bootstrap context (and all it's beans) are destroyed during bootstrap context refresh. Change-Id: Ib02cd49c37935422d4ca861afee55f621015146e Issue-ID: DCAEGEN2-1647 Signed-off-by: grabinsk --- .../onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java index df318550..f668a581 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java @@ -30,6 +30,7 @@ import org.springframework.context.annotation.Configuration; @Configuration @EnableConfigurationProperties(CbsProperties.class) public class CbsBootstrapConfiguration { + private static final CbsConfiguration CBS_CONFIGURATION = new CbsConfiguration(); @Bean public CbsProperties cbsProperties() { @@ -52,6 +53,6 @@ public class CbsBootstrapConfiguration { @Bean public CbsConfiguration cbsConfiguration() { - return new CbsConfiguration(); + return CBS_CONFIGURATION; } } -- cgit 1.2.3-korg