Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

#PersonApproach
1

[Relates to point 3 from high-level steps]

It would be good to have async implementation only dependent on NCMP. So that it does not break or work with only few DMI plugins. 
I think a DMI plugin independent async flow would be like 
1. Once request is received, check if  dmi plugin exist. If exists, generate request uuid, send the message to the Kafka topic (or store it in DB), and send an accepted response back to client.
2. NCMP will listen to the same topic or read from the DB. Process it by calling appropriate DMI Plugins synchronously. After it receives the response back, it sends to to Kafka topic provided in the input by user. 

In this implementation, we are not dependent on the DMI implementation. 
We do need persistence for storing async request. It can be a stored in DB or Kafka, it does not matter as long as we can read it in the same order. 

The main points are
1. No dependency on the DMI for async behavior

2. No async request get lost because of pod restart or JVM crash. 


Proposed Message Format

...


Infocode
iconfalse

--------------------------------------------------------------------------------------------------------------------------------------------------------------

black is NCMP standard event schema.
Blue is the event payload schema as per org.onap.ncmp:async-request-response-event:v1.
Light grey is the response payload schema.  The payload schema is an onap one if non-passthrough but may
be either an onap published or other (oran, proprietary, etc) schema if the original call received by the dmi plugin is a ncmp:passthrough-*.

SCOPE OF THE WORK :  the black highlighted parts of the above events. 
The blue highlight is not in current scope.  The blue bits will be up to the dmi plugins.
In the future these blue bits may become part of the standard onap base release.

Success Scenario


Info
iconfalse

DMI Event sent to NCMP
------------------------------- 

{

  "eventId"                    : "9999",                                                                      # some generic event uuid generated by DMI Plugin
  “eventCorrelationId” : “request-009995”,                                                      # for event correlation - acts as the request Id when
                                                                                                                        # eventType=org.onap.ncmp.async-request-response-event
  "eventTime"             : "2021-11-16T16:42:25-04:00",
  "eventSource"          : "org.onap.ncmp",                                                        # ??? Is this needed?
  "eventType"             :

languageyml
titleDMI Event sent to NCMP
collapsetrue
{ "eventId" : "9999", # some generic event uuid generated by DMI Plugin “eventCorrelationId” : “request-009995”, # for event correlation - acts as the request Id when eventType=async-request-response-event "eventTime" : "2021-11-16T16:42:25-04:00", "eventSource" : "org.onap.ncmp", # ??? Is this needed? "eventType" :

"org.onap.ncmp.async-request-response-event",

# event type for async request response events ”eventSchema” : “org

       # event type for async request response events
  ”eventSchema”        : “org.onap.ncmp:async-request-response-event:v1",

#

 # event

schema

for

async

request

response

events “eventTarget” :

events
  “eventTarget”            : “topic:client-application-topic”,

# indicates where to route the event - ‘topic’ is default target type "event" : {

                                 # indicates where to route the event
                                                                                                                        # - ‘topic’ is default target type
  "event": {
     “response-data-schema”

:

“org

org.onap.cps.yang-patch-json:

v1”, “response-status” : “SUCCESS”, “response-code” : “200”, “response-data” : { … <response-data-payload> # This is same as would be returned by synchronous call … } }

v1”,
     “response-status” : “SUCCESS”,
     “response-code”   : “201”,
     “response-data” : {
            …
           <response-data-payload>
           …
     }
  }
}


  • Is this not NCMP to DMI rather than DMI to NCMP?
  • Should response code above be OK?
  • Is there too much information being returned to NCMP?
    • Should we just return OK??


Code Blockinfo
languageiconymlfalsetitle

NCMP Event forwarded to Client topic (in eventTarget)

collapsetrue

----------------------------------------------------------------------

{

{ "eventId" : "33001", # some generic event uuid generated by NCMP “eventCorrelationId” : “request-009995”, # for event correlation - acts as the request Id when eventType=sync-request-response-event "eventTime" :

  "eventId"                    : "33001",                                                                    # some generic event uuid generated by NCMP
  “eventCorrelationId” : “request-009995”,                                                      # for event correlation - acts as the request Id when
                                                                                                                        # eventType=org.onap.ncmp.async-request-response-event
  "eventTime"             : 

"2015-11-16T16:42:26-05:06",


  "eventSource"

:

          : "org.onap.ncmp",

# The source of the event "eventType" :

                                                        # The source of the event
  "eventType"             : "org.onap.ncmp.async-request-response-event",

# event type for async request response events ”eventSchema” : “org

       # event type for async request response events
  ”eventSchema”        : “org.onap.ncmp:async-request-response-event:v1",

#

 # event

schema

for

async

request

response

events

events

  "eventOrigin"

          :

{ "eventId" : "00001", # some generic event uuid generated by DMI Plugin "eventTime" :

{

        "eventId"                    : "00001",                                                                     # some generic event uuid generated by DMI Plugin
        "eventTime"               : "2021-11-16T16:42:25-04:00",

“eventCorrelationId” : “request-009995”, # Matches eventCorrelationId for new message to client for auditing       "eventSource" :


        “eventCorrelationId” : “request-009995”,     
        "eventSource"           : "org.onap.dmi",

# ??? Is this needed? "eventType" :

                                                           # ??? Is this needed?
        "eventType"               : "org.onap.ncmp.async-request-response-event",

# event type for async request response events ”eventSchema” : “org

      # event type for async request response events
        ”eventSchema”          : “org.onap.ncmp:async-request-response-event:v1",

#

 # event

schema

for

async

request

response

events “eventTarget” :

events
        “eventTarget”            : “topic:client-application-topic”

},


   }


  "event"

:

{

{
     “response-data-schema”

:

“org

org.onap.cps.yang-patch-json:

v1”, “response-status” : “SUCCESS”, “response-code” : “200”, “response-data” : { … <response-data-payload> … } } }

Failure Scenario

v1”,
     “response-status” : “SUCCESS”,
     “response-code”   : “201”,
     “response-data” : {
            …
           <response-data-payload>
           …
     }
  }
}


Failure Scenario


Info
iconfalse
Code Block
title
languageyml

DMI Event sent to NCMP

collapsetrue

------------------------------- 

{

  "eventId"                    : "9999",                                                                    # some generic event uuid generated by DMI Plugin
  “eventCorrelationId” : “request-009995”,                                                    # for event correlation - acts as the request Id when
                                                                                                                       # eventType=org.onap.ncmp.

{ "eventId" : "9999", # some generic event uuid generated by DMI Plugin “eventCorrelationId” : “request-009995”, # for event correlation - acts as the request Id when eventType=

async-request-response-event


  "eventTime"

:

             : "2021-11-16T16:42:25-04:00",


  "eventSource"

:

          : "org.onap.ncmp",

# ??? Is this needed? "eventType" :

                                                       # ??? Is this needed?
  "eventType"             : "org.onap.ncmp.async-request-response-event",

# event type for async request response events ”eventSchema” : “org

      # event type for async request response events
  ”eventSchema”        : “org.onap.ncmp:async-request-response-event:v1",

#

 # event

schema

for

async

request

response

events “eventTarget” :

events
  “eventTarget”            : “topic:client-application-topic”

” # indicates where to route the event - ‘topic’ is default target type                           "event" : { “response-data-schema” : “org

,                                # indicates where to route the event
                                                                                                                         # - ‘topic’ is default target type
  "event": {
     “response-data-schema” : “org.onap.cps.generic-error:

v1”, “response-status” : “FAILURE”, “response-code” : “404”, “response-data” : { … <response

v1”,
     “response-status” : “FAILURE”,
     “response-code”   : “404”,
     “response-data” : {
            …
           <response-data-payload-as-org.onap.ncmp

.generic-error:v1> … } } }
Code Block

.generic-error:v1>
           …
     }
   }
}


Info
iconfalse
languageyml
title

NCMP Event forwarded to Client topic (defined in eventTarget)

collapsetrue

----------------------------------------------------------------------

{

  "eventId"                    : "33001",                                                                  # some generic event uuid generated by NCMP
  “eventCorrelationId” : “request-009995”,                                                    # for event correlation - acts as the request Id when
                                                                                                                       # eventType=org.onap.ncmp.

{ "eventId" : "33001", # some generic event uuid generated by NCMP “eventCorrelationId” : “request-009995”, # for event correlation - acts as the request Id when eventType=

async-request-response-event


  "eventTime"

:

             : "2015-11-16T16:42:26-05:06",


  "eventSource"

:

          : "org.onap.ncmp",

# The source of the event "eventType" :

                                                       # The source of the event
  "eventType"             : "org.onap.ncmp.async-request-response-event",

# event type for async request response events ”eventSchema” : “org

      # event type for async request response events
  ”eventSchema”        : “org.onap.ncmp:async-request-response-event:v1",

#

 # event

schema

for

async

request

response

events

events

  "eventOrigin"

          :

{ "eventId" : "00001", # some generic event uuid generated by DMI Plugin "eventTime" :

{

        "eventId"                    : "00001",                                                                       # some generic event uuid generated by DMI Plugin
        "eventTime"               : "2021-11-16T16:42:25-04:00",

“eventCorrelationId” : “request-009995”, "eventSource" :


        “eventCorrelationId” : “request-009995”,     
        "eventSource"           : "org.onap.dmi",

# ??? Is this needed? "eventType" :

                                                             # ??? Is this needed?
        "eventType"               : "org.onap.ncmp.async-request-response-event",

# event type for async request response events ”eventSchema” : “org

       # event type for async request response events
        ”eventSchema”          : “org.onap.ncmp:async-request-response-event:v1",

#

 # event

schema

for

async

request

response

events “eventTarget” :

events
        “eventTarget”            : “topic:client-application-topic”

}

,
   }


  "event"

:

{

{
     “response-data-schema”

:

“org

org.onap.cps.generic-error:

v1”, “response-status” : “FAILURE”, “response-code” : “404”, “response-data” : { … <response

v1”,
     “response-status” : “FAILURE”,
     “response-code”   : “404”,
     “response-data” : {
            …
           <response-data-payload-as-org.onap.ncmp.

generic

generic-error:v1>

… } }


           …
     }
  }
}


Kafka config & Implementation

...