From 910885f2cc98956acac1ef18a554f40f856590e3 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 24 Jul 2020 13:11:39 -0400 Subject: 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 Change-Id: I91813208f0474869f174da6c99280b5159859232 --- .../selfservice/api/BluePrintProcessingKafkaConsumer.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/modules/inbounds') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumer.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumer.kt index a95af8123..1f3dd6547 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumer.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumer.kt @@ -16,6 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api +import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.channels.consumeEach import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking @@ -55,7 +56,7 @@ open class BluePrintProcessingKafkaConsumer( } @EventListener(ApplicationReadyEvent::class) - fun setupMessageListener() = runBlocking { + fun setupMessageListener() = GlobalScope.launch { try { log.info( "Setting up message consumer($CONSUMER_SELECTOR)" + -- cgit 1.2.3-korg