From e37979a0a96f59b75b2df4f299840b6caeeb6ee8 Mon Sep 17 00:00:00 2001 From: ChuanyuChen Date: Fri, 2 Sep 2022 17:14:13 +0800 Subject: Fix Sent Wrong Dmaap Message Issue Fix Sent Wrong Dmaap Message Issue Issue-ID: DCAEGEN2-3245 Signed-off-by: ChuanyuChen Change-Id: I8ff10e85bffc044022cfc3bcba21bdd757ffe8ce --- components/slice-analysis-ms/ChangeLog.md | 2 ++ .../org/onap/slice/analysis/ms/dmaap/NotificationProducer.java | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'components') diff --git a/components/slice-analysis-ms/ChangeLog.md b/components/slice-analysis-ms/ChangeLog.md index bae8280d..56655a68 100644 --- a/components/slice-analysis-ms/ChangeLog.md +++ b/components/slice-analysis-ms/ChangeLog.md @@ -4,10 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). + ## [1.1.4] - 2022/07/28 - [DCAEGEN2-3120](https://jira.onap.org/browse/DCAEGEN2-3120) - Enhance sliceanalysis MS to use DCAE SDK dmaap-client lib - [DCAEGEN2-3157](https://jira.onap.org/browse/DCAEGEN2-3157) - CodeCoverage improvement for dcaegen2-services-slice-analysis-ms - [DCAEGEN2-3242](https://jira.onap.org/browse/DCAEGEN2-3242) - Fix bug in ConfigFectchFromCbs that fetch will get hung when policy config in pdp engine is empty + - [DCAEGEN2-3245](https://jira.onap.org/browse/DCAEGEN2-3245) - Fix sent wrong dmaap message issue. ## [1.1.3] - 2022/05/11 - [DCAEGEN2-3156](https://jira.onap.org/browse/DCAEGEN2-3156) - Fix bug in fetching PM data from DES diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/NotificationProducer.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/NotificationProducer.java index 55f24a65..66e5d5df 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/NotificationProducer.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/NotificationProducer.java @@ -22,14 +22,14 @@ package org.onap.slice.analysis.ms.dmaap; -import com.google.gson.JsonPrimitive; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import java.io.IOException; import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.api.MessageRouterPublisher; import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.model.MessageRouterPublishRequest; import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.model.MessageRouterPublishResponse; import reactor.core.publisher.Flux; -import java.io.IOException; - /** * Produces Notification on DMAAP events */ @@ -51,7 +51,8 @@ public class NotificationProducer { * sends notification to dmaap. */ public void sendNotification(String msg) throws IOException { - Flux singleMessage = Flux.just(msg).map(JsonPrimitive::new); + JsonElement jsonElement = JsonParser.parseString(msg); + Flux singleMessage = Flux.just(jsonElement); Flux result = this.publisher.put(request, singleMessage); result.then().block(); } -- cgit 1.2.3-korg