aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/application/src/main/kotlin
diff options
context:
space:
mode:
authorSebastien Premont-Tendland <sebastien.premont@bell.ca>2020-02-17 11:14:02 -0500
committerSebastien Premont-Tendland <sebastien.premont@bell.ca>2020-02-17 11:30:57 -0500
commitaa7eeb999f1fcb7edc190fbcefe9747fc6e63059 (patch)
treea84dffc4fdde79555ae81602e6c1c69eb55a9768 /ms/blueprintsprocessor/application/src/main/kotlin
parente0e8b14e106cff2dccc76e6edcc1a7ee6ffe10da (diff)
Removed manual shutdown hook for hazelcast
Shutdown hook for hazelcast are already working with spring boot. Just changed the policy to GRACEFUL (default is TERMINATE). This allow hazelcast to shutdown gracefully and recover from a rolling upgrade Also updated the Dockerfile to use multi stage to reduce by ~200Mb the docker image size. Issue-ID: CCSDK-2011 Signed-off-by: Sebastien Premont-Tendland <sebastien.premont@bell.ca> Change-Id: I0034145c7acefa88ed8d16f23a29249c7225ace3
Diffstat (limited to 'ms/blueprintsprocessor/application/src/main/kotlin')
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BluePrintProcessorCluster.kt7
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt3
2 files changed, 2 insertions, 8 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BluePrintProcessorCluster.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BluePrintProcessorCluster.kt
index f7296d421..2284a6fc0 100644
--- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BluePrintProcessorCluster.kt
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BluePrintProcessorCluster.kt
@@ -25,9 +25,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.utils.ClusterUtils
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.event.EventListener
import org.springframework.stereotype.Component
-import java.time.Duration
import java.util.Properties
-import javax.annotation.PreDestroy
/**
* To Start the cluster, minimum 2 Instances/ Replicas od CDS needed.
@@ -85,9 +83,4 @@ open class BluePrintProcessorCluster(private val bluePrintClusterService: BluePr
log.info("Cluster is disabled, to enable cluster set the environment CLUSTER_* properties.")
}
}
-
- @PreDestroy
- fun shutDown() = runBlocking {
- bluePrintClusterService.shutDown(Duration.ofMillis(1))
- }
}
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt
index 3709a9785..1d1baeeef 100644
--- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt
@@ -19,6 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.SpringBootApplication
+import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
import org.springframework.context.annotation.ComponentScan
@@ -28,7 +29,7 @@ import org.springframework.context.annotation.ComponentScan
* @author Brinda Santh
*/
@SpringBootApplication
-@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class])
+@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class, HazelcastAutoConfiguration::class])
@ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
open class BlueprintProcessorApplication