From: grabinsk Date: Tue, 2 Jul 2019 14:05:24 +0000 (+0200) Subject: fix CbsConfiguration update bug X-Git-Tag: 1.3.1~11 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F20%2F90820%2F1;p=dcaegen2%2Fservices%2Fprh.git 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 --- 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; } }