From 8d94f0bd0a9e4d1c57e98df726841dd0e2978569 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 4 Sep 2019 21:44:59 -0400 Subject: Add Kafka message lib consumer services Change-Id: Iaf1df07a0d8f4fb54d5d06047520010d3bfe5465 Issue-ID: CCSDK-1668 Signed-off-by: Brinda Santh --- .../selfservice/api/MessagingController.kt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/MessagingController.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/MessagingController.kt index 54cc0c129..e848ed384 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/MessagingController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/MessagingController.kt @@ -26,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.kafka.annotation.KafkaListener import org.springframework.stereotype.Service +//TODO("Implement with property service and remove spring bindings") @ConditionalOnProperty(name = ["blueprintsprocessor.messageclient.self-service-api.kafkaEnable"], havingValue = "true") @Service open class MessagingController(private val propertyService: BluePrintMessageLibPropertyService, @@ -56,18 +57,16 @@ open class MessagingController(private val propertyService: BluePrintMessageLibP val executionServiceOutput = executionServiceHandler.doProcess(executionServiceInput) - if (executionServiceOutput.status.code == EXECUTION_STATUS) { - val bluePrintMessageClientService = propertyService - .blueprintMessageClientService(PREFIX) + if (executionServiceOutput.status.code == EXECUTION_STATUS) { + val blueprintMessageProducerService = propertyService.blueprintMessageProducerService(PREFIX) - val payload = executionServiceOutput.payload + val payload = executionServiceOutput.payload - log.info("The payload to publish is {}", payload) + log.info("The payload to publish is {}", payload) - bluePrintMessageClientService.sendMessage(payload) - } - else { - log.error("Fail to process the given event due to {}", executionServiceOutput.status.errorMessage) - } + blueprintMessageProducerService.sendMessage(payload) + } else { + log.error("Fail to process the given event due to {}", executionServiceOutput.status.errorMessage) + } } } -- cgit 1.2.3-korg