aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin
diff options
context:
space:
mode:
authorJulien Fontaine <julien.fontaine@bell.ca>2021-06-23 08:44:00 -0400
committerJulien Fontaine <julien.fontaine@bell.ca>2021-06-23 12:34:20 -0400
commitcc7b12386f6ada2cabead94da33cf3ed68ac8cf7 (patch)
treec3ff09688d1a8b12f28a91815bcd15cc9309b753 /ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin
parent5ae1f987e90bc27cf404e0a308ea93f7059299ab (diff)
Add Request ID and Sub Request ID to CDS kafka logs
Improved log message when a message is published or consumed by CDS Kafka to specify the RequestID and SubRequestID. Issue-ID: CCSDK-3348 Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca> Change-Id: I50e068d9aa36df8fe4ee5f0f6a8e9bd7a1209467
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin')
-rw-r--r--ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/utils/BlueprintMessageUtils.kt13
1 files changed, 5 insertions, 8 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/utils/BlueprintMessageUtils.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/utils/BlueprintMessageUtils.kt
index b4817cd8a..644bd7ba1 100644
--- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/utils/BlueprintMessageUtils.kt
+++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/utils/BlueprintMessageUtils.kt
@@ -17,8 +17,7 @@
package org.onap.ccsdk.cds.blueprintsprocessor.message.utils
import io.micrometer.core.instrument.Tag
-import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonExecutionServiceData
import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.defaultToUUID
import kotlin.math.max
@@ -41,13 +40,11 @@ class BlueprintMessageUtils {
fun getMessageLogData(message: Any): String =
when (message) {
- is ExecutionServiceInput -> {
+ is CommonExecutionServiceData -> {
val actionIdentifiers = message.actionIdentifiers
- "CBA(${actionIdentifiers.blueprintName}/${actionIdentifiers.blueprintVersion}/${actionIdentifiers.actionName})"
- }
- is ExecutionServiceOutput -> {
- val actionIdentifiers = message.actionIdentifiers
- "CBA(${actionIdentifiers.blueprintName}/${actionIdentifiers.blueprintVersion}/${actionIdentifiers.actionName})"
+ val commonHeaders = message.commonHeader
+ "requestID(${commonHeaders.requestId}), subrequestID(${commonHeaders.subRequestId}) " +
+ "CBA(${actionIdentifiers.blueprintName}/${actionIdentifiers.blueprintVersion}/${actionIdentifiers.actionName})"
}
else -> "message($message)"
}