/
CPS-1392 NCMP Consume Subscription Event

CPS-1392 NCMP Consume Subscription Event

References

CPS-1392: NCMP - Consume Subscription Creation EventClosed

Steps



  1. Consume Event

  2. Check if dataCategory is 'CM'

  3. log consumption

  4. Check scheme

  5. Create object

  6. Log object





Consumer Pseudo Code

Pseudo Code
public class SubscriptionCreatedEventConsumer { @KafkaListener(topics = "${app.ncmp.cm-avc-subscription.topic}") //Blocking: See issue #2 public void consumeSubscriptionEvent(final SubscriptionCreatedEvent subscriptionCreatedEvent){ if(subscriptionCreatedEvent.dataCategory == 'CM'){ //Check dataCategory log.debug("Consuming event {} ...", subscriptionCreatedEvent); if(checkFormat(subscriptionCreatedEvent)){ //Check format of message Subscription createSubscription = new Subscription() //Create Object log.debug("subscription created "+ createSubscription) //Log subscription } } } public boolean checkFormat(SubscriptionCreatedEvent event){ //Blocking: See issue #1 } }



Subscription Object - Will be finalised when schema confirmed

Object Parameters
String clientID Stirng name String subscriptionID = clientID+name Boolean isTagged = default no String dataspace String dataCategory = necessary? should always be 'CM' String dataProvidor String schemeName String schemaVersion Collection persistence

Issues & Decisions

Issue

Notes 

Decision

Issue

Notes 

Decision

1

Subscription Event Scheme

Protocol : Kafka Event
Topic : variable topic name

Event Scheme
{ "version": "<event type version>", "eventType": "subscriptionCreated", "event": { "subscription": { "clientID": "<unique identifier for the client >", "name": "<unique subscription name per client>", "isTagged": "<yes|no>, optional parameter, default is no" }, "dataType": { "dataspace": "<data space>", "dataCategory": "<data category type>", "dataProvider": "<data provider type>" "schemaName": "<schema name>" "schemaVersion": "<schema version>" }, "predicates": { "<parameter>": "<value>", "param2": [ "value21", "value22" ] } } }





2

Configurable Topic

Pointer where previously implemented







Related content

CPS Data Notifications Overview
CPS Data Notifications Overview
More like this
CPS-1489: Overview of Kafka Topics in CPS Components
CPS-1489: Overview of Kafka Topics in CPS Components
More like this
CPS-2067 Granular control of CPS core notifications
CPS-2067 Granular control of CPS core notifications
More like this
CPS-1065 Spike: CM data notifications from NCMP to applications including subscriptions
CPS-1065 Spike: CM data notifications from NCMP to applications including subscriptions
More like this
CPS-2436 NCMP to populate the source key in the target topic to support retaining the order of CM Data Notifications
CPS-2436 NCMP to populate the source key in the target topic to support retaining the order of CM Data Notifications
More like this
CPS-2425 Event Schemas in ONAP
CPS-2425 Event Schemas in ONAP
More like this