diff options
author | sourabh_sourabh <sourabh.sourabh@est.tech> | 2024-07-31 17:19:19 +0100 |
---|---|---|
committer | sourabh_sourabh <sourabh.sourabh@est.tech> | 2024-08-02 10:20:00 +0100 |
commit | b0c7b0e43956ef48011c95b2689578acbfd9282f (patch) | |
tree | 583dd9eaf86bb2217fe38f2e261b2ef7d73db4b8 /cps-ncmp-service/src/main | |
parent | 81bf6fb1badc3c41d41c501330bc2a462f20c786 (diff) |
Updating CM Data Notification Event Schema
- Updated "avc-event-schema" value attribute to accept type object.
- Modified cm avc event consumer to not wrap received event into another cloud event using "CloudEventBuilder.from"
Issue-ID: CPS-2299
Change-Id: I3b2acd53a3939d992b337e98debb7f62f3a528dd
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/cmavc/CmAvcEventConsumer.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/cmavc/CmAvcEventConsumer.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/cmavc/CmAvcEventConsumer.java index 0207fb90e3..9e90eabbc4 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/cmavc/CmAvcEventConsumer.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/cmavc/CmAvcEventConsumer.java @@ -21,8 +21,6 @@ package org.onap.cps.ncmp.impl.cmnotificationsubscription.cmavc; import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import java.util.UUID; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.ConsumerRecord; @@ -56,11 +54,8 @@ public class CmAvcEventConsumer { containerFactory = "cloudEventConcurrentKafkaListenerContainerFactory") public void consumeAndForward( final ConsumerRecord<String, CloudEvent> cmAvcEventAsConsumerRecord) { - log.debug("Consuming AVC event {} ...", cmAvcEventAsConsumerRecord.value()); - final String newEventId = UUID.randomUUID().toString(); - final CloudEvent outgoingAvcEvent = - CloudEventBuilder.from(cmAvcEventAsConsumerRecord.value()).withId(newEventId) - .build(); - eventsPublisher.publishCloudEvent(cmEventsTopicName, newEventId, outgoingAvcEvent); + final CloudEvent outgoingAvcEvent = cmAvcEventAsConsumerRecord.value(); + log.debug("Consuming AVC event {} ...", outgoingAvcEvent); + eventsPublisher.publishCloudEvent(cmEventsTopicName, outgoingAvcEvent.getId(), outgoingAvcEvent); } } |