diff options
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); } } |