summaryrefslogtreecommitdiffstats
path: root/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java
diff options
context:
space:
mode:
authorKai <lukai@chinamobile.com>2021-03-29 11:48:10 +0800
committerRemigiusz Janeczek <remigiusz.janeczek@nokia.com>2021-05-12 17:11:08 +0200
commit9bb841d5faa995c2170057f93cd65303fba7979c (patch)
treeb3fe5deaa60844546984d74adb82b9217a6f4705 /dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java
parent6302edb304f69068b108a69001d69bc6213b6a6a (diff)
Fix mongodb errors on application startup1.3.0-tca-gen2
Revert Dockerfile refactor due to permissions issues Issue-ID: DCAEGEN2-2747 Issue-ID: DCAEGEN2-2590 Signed-off-by: Kai Lu <lukai@chinamobile.com> Change-Id: I84075575cc75090876416cb13e0ac197a8e0f6e3 Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java')
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java
index 3579d3e..ed8e7ea 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaMrConfig.java
@@ -1,6 +1,8 @@
/*
* ================================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2021 China Mobile Property. All rights reserved.
+ * Copyright (c) 2021 Nokia Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,8 +25,6 @@ import static org.onap.dcae.analytics.model.AnalyticsHttpConstants.REQUEST_ID_HE
import static org.onap.dcae.analytics.model.AnalyticsHttpConstants.REQUEST_TRANSACTION_ID_HEADER_KEY;
import java.util.List;
-import java.util.Map;
-
import org.onap.dcae.analytics.model.AnalyticsProfile;
import org.onap.dcae.analytics.model.DmaapMrConstants;
import org.onap.dcae.analytics.tca.web.TcaAppProperties;
@@ -44,6 +44,7 @@ import org.springframework.integration.channel.NullChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
+import org.springframework.integration.handler.GenericHandler;
import org.springframework.messaging.MessageHeaders;
/**
@@ -82,11 +83,15 @@ public class TcaMrConfig {
// get messages from dmaap subscriber channel
return IntegrationFlows.from(mrSubscriberOutputChannel)
// handle incoming message from dmaap
- .handle((List<String> cefMessages, Map<String, Object> headers) ->
- tcaProcessingService.getTcaExecutionResults(
+ .handle(new GenericHandler<List<String>>() {
+ @Override
+ public Object handle(List<String> cefMessages, MessageHeaders headers) {
+ return tcaProcessingService.getTcaExecutionResults(
headers.getOrDefault(REQUEST_ID_HEADER_KEY, headers.get(MessageHeaders.ID)).toString(),
headers.getOrDefault(REQUEST_TRANSACTION_ID_HEADER_KEY, "").toString(),
- tcaPolicyWrapper, cefMessages))
+ tcaPolicyWrapper, cefMessages);
+ }
+ })
// transform tca execution results to alerts - if not alerts are detected terminate further processing
.transform(tcaAlertTransformer, c -> c.requiresReply(false))
// post messages to dmaap publisher input channel