aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/application/src/main
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2020-07-24 13:11:39 -0400
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2020-07-24 19:06:53 +0000
commit910885f2cc98956acac1ef18a554f40f856590e3 (patch)
treefcf1fcb14a5df8f203d2a8dae00dd4a337607bd5 /ms/blueprintsprocessor/application/src/main
parent8f917294bf447bc31826841198b832cf134bf20f (diff)
Change EventListener functions to non-blocking scope
BluePrintProcessingKafkaConsumer and BluePrintProcessorCluster were both defining EventListener functions which were executed with runBlocking. When both were enabled, kafkaconsumer would block and cluster would never run. Issue-ID: CCSDK-2609 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: I91813208f0474869f174da6c99280b5159859232
Diffstat (limited to 'ms/blueprintsprocessor/application/src/main')
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BluePrintProcessorCluster.kt5
1 files changed, 3 insertions, 2 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 2284a6fc0..513bd5135 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
@@ -16,7 +16,8 @@
package org.onap.ccsdk.cds.blueprintsprocessor
-import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterInfo
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
@@ -57,7 +58,7 @@ open class BluePrintProcessorCluster(private val bluePrintClusterService: BluePr
private val log = logger(BluePrintProcessorCluster::class)
@EventListener(ApplicationReadyEvent::class)
- fun startAndJoinCluster() = runBlocking {
+ fun startAndJoinCluster() = GlobalScope.launch {
if (BluePrintConstants.CLUSTER_ENABLED) {