elinuxhenrik | 1cd0f2e | 2022-03-28 09:48:52 +0200 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. SPDX-License-Identifier: CC-BY-4.0 |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 3 | .. Copyright (C) 2022 Nordix |
elinuxhenrik | 1cd0f2e | 2022-03-28 09:48:52 +0200 | [diff] [blame] | 4 | |
| 5 | |
| 6 | DMaaP Adapter |
| 7 | ~~~~~~~~~~~~~ |
| 8 | |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 9 | ************ |
| 10 | Introduction |
| 11 | ************ |
elinuxhenrik | 1cd0f2e | 2022-03-28 09:48:52 +0200 | [diff] [blame] | 12 | |
PatrikBuhr | 4bfffa6 | 2022-06-20 13:16:38 +0200 | [diff] [blame] | 13 | This is a generic information producer using the Information Coordination Service (ICS) Data Producer API. It can get information from DMaaP (ONAP) or directly from Kafka topics. |
| 14 | The information can be filtered, transformed, aggregated and then delivered to data consumers using REST calls (POST) or via Kafka. |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 15 | |
| 16 | The DMaaP Adapter registers itself as an information producer along with its information types in Information Coordination Service (ICS). |
elinuxhenrik | 1cd0f2e | 2022-03-28 09:48:52 +0200 | [diff] [blame] | 17 | The information types are defined in a configuration file. |
elinuxhenrik | 1cd0f2e | 2022-03-28 09:48:52 +0200 | [diff] [blame] | 18 | |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 19 | A data consumer can create an information job (data subscription) using the ICS consumer API (for R-Apps) or the A1-EI (Enrichment Information) API (for NearRT-RICs) based on the registered information types. |
| 20 | This service will get data from DMaaP MR or Kafka topics and deliver it to the data consumers based on their created subscription jobs. |
| 21 | |
| 22 | So, a data consumer may be decoupled from DMaaP and/or Kafka this way. |
| 23 | |
| 24 | The service is implemented in Java Spring Boot (DMaaP Adapter Service). |
| 25 | |
| 26 | .. image:: ./Architecture.png |
| 27 | :width: 500pt |
| 28 | |
elinuxhenrik | 873c5b9 | 2022-06-23 10:37:43 +0200 | [diff] [blame] | 29 | This product is a part of :doc:`NONRTRIC <nonrtric:index>`. |
| 30 | |
PatrikBuhr | 4bfffa6 | 2022-06-20 13:16:38 +0200 | [diff] [blame] | 31 | ************* |
| 32 | Data Delivery |
| 33 | ************* |
elinuxhenrik | 4a303fb | 2022-06-29 15:28:23 +0200 | [diff] [blame] | 34 | When a data consumer creates an Information Job, either a URL for REST callbacks, or a Kafka Topic can be given as output for the job. |
PatrikBuhr | 4bfffa6 | 2022-06-20 13:16:38 +0200 | [diff] [blame] | 35 | After filtering, aggregation and data transformation the data will be delivered to the output. Several data consumers can receive data from one Kafka Topic. |
| 36 | |
| 37 | .. image:: ./DataDelivery.png |
| 38 | :width: 500pt |
| 39 | |
| 40 | The output will be the same regardless if the information is received from DMaaP of from Kafka. If the data is not buffered/aggregated, |
| 41 | and the output is a Kafka Stream, both the keys and the values are forwarded (after filtering/transformation). |
elinuxhenrik | 4a303fb | 2022-06-29 15:28:23 +0200 | [diff] [blame] | 42 | If the output is HTTP, only the the values are forwarded (in the HTTP body). |
PatrikBuhr | 4bfffa6 | 2022-06-20 13:16:38 +0200 | [diff] [blame] | 43 | |
| 44 | **************** |
| 45 | Data Aggregation |
| 46 | **************** |
| 47 | When an Information Job is created, a bufferTimeout can be defined for aggregation of information. |
| 48 | If this feature is used, the subscribed data will be buffered and will be delivered in chunks. |
| 49 | |
| 50 | The data will then be wrapped in a JSON array in a manner similar to DMaaP. The type configuration can define if the received data is Json. |
| 51 | If not, each object is quoted (the output will then be an array of strings). If the data type is Json, the output will be an array of Json objects. |
| 52 | |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 53 | ****************** |
| 54 | Configuration File |
| 55 | ****************** |
| 56 | |
| 57 | The configuration file defines which DMaaP and Kafka topics that should be listened to and registered as subscribeable information types. |
| 58 | There is an example configuration file in config/application_configuration.json |
| 59 | |
| 60 | Each entry will be registered as a subscribe information type in ICS. The following attributes can be used in each entry: |
| 61 | |
| 62 | * id, the information type identifier. |
| 63 | |
| 64 | * dmaapTopicUrl, a URL to use to retrieve information from DMaaP. Defaults to not listen to any topic. |
| 65 | |
| 66 | * kafkaInputTopic, a Kafka topic to listen to. Defaults to not listen to any topic. |
| 67 | |
| 68 | * useHttpProxy, indicates if a HTTP proxy shall be used for data delivery (if configured). Defaults to false. |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 69 | This parameter is only relevant if a HTTPproxy is configured in the application.yaml file. |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 70 | |
| 71 | * dataType, this can be set to "pmData" which gives a possibility to perform a special filtering of PM data. |
| 72 | |
PatrikBuhr | 2b459a1 | 2022-06-08 10:12:00 +0200 | [diff] [blame] | 73 | * isJson, this indicates that the received is Json objects (from Kafka a stream of objects and from DMaaP an array of quoted json objects). |
| 74 | Default value is false. |
| 75 | If the received data is Json objects, the data sent to the consumer does not need to be quoted. |
| 76 | When buffering is used the output will be an array of json objects '[{},{}]' as opposed to an array of strings '["string1", "string2"]'. |
| 77 | When buffering is not used, the output content-type will be 'application/json' as opposed to 'text/plain'. When buffering is used, the |
| 78 | output content-type will 'application/json' regardless of this parameter. |
| 79 | |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 80 | These parameters will be used to choose which parameter schemas that defines which parameters that can be used when creating an information job/data subscription. |
| 81 | |
| 82 | Below follows an example of a configuration file. |
| 83 | |
| 84 | .. code-block:: javascript |
| 85 | |
| 86 | { |
| 87 | "types": [ |
| 88 | { |
| 89 | "id": "DmaapInformationType", |
| 90 | "dmaapTopicUrl": "/dmaap-topic-1", |
PatrikBuhr | 2b459a1 | 2022-06-08 10:12:00 +0200 | [diff] [blame] | 91 | "useHttpProxy": true, |
| 92 | "isJson" : true |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 93 | }, |
| 94 | { |
| 95 | "id": "KafkaInformationType", |
| 96 | "kafkaInputTopic": "TutorialTopic", |
| 97 | }, |
| 98 | { |
| 99 | "id": "PmInformationType", |
| 100 | "dmaapTopicUrl": "/dmaap-topic-2", |
PatrikBuhr | 2b459a1 | 2022-06-08 10:12:00 +0200 | [diff] [blame] | 101 | "dataType": "PmData", |
| 102 | "isJson" : true |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 103 | } |
| 104 | ] |
| 105 | } |
| 106 | |
| 107 | ************************** |
| 108 | Information Job Parameters |
| 109 | ************************** |
| 110 | |
| 111 | When an information consumer creates an information job,it can provide type specific parameters. The allowed parameters are defined by a Json Schema. |
| 112 | The following schemas can be used by the component (are located in dmaapadapter/src/main/resources): |
| 113 | |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 114 | =============== |
| 115 | typeSchema.json |
| 116 | =============== |
| 117 | This schema will by default be registerred for the type. The following properties are defined: |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 118 | |
PatrikBuhr | 4bfffa6 | 2022-06-20 13:16:38 +0200 | [diff] [blame] | 119 | * kafkaOutputTopic, optional parameter which enables the information job to output data to a Kafka topic instead of a direct call to a data consumer. The output of a job can be directed to HTTP or to Kafka regardless if the input is retrieved from DMaaP or from Kafka. |
| 120 | |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 121 | * filterType, selects the type of filtering that will be done. This can be one of: "regexp", "json-path", "jslt". |
| 122 | |
| 123 | * regexp is for standard regexp matching of text. Objects that contains a match of the expression will be pushed to the consumer. |
| 124 | * json-path can be used for extracting relevant data from json. |
| 125 | * jslt, which is an open source language for JSON processing. It can be used both for selecting matching json objects and for extracting or even transforming of json data. This is very powerful. |
| 126 | |
| 127 | * filter, the value of the filter expression. |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 128 | * bufferTimeout can be used to buffer several json objects received from Kafka when kafkaInputTopic is defined into one json array. If bufferTimeout is used, the delivered data will be a Json array of the objects received. If not, each received object will be delivered in a separate call. This contains: |
| 129 | |
| 130 | * maxSize, the maximum number of objects to collect before delivery to the consumer |
| 131 | * maxTimeMiliseconds, the maximum time to delay delivery (to buffer). |
| 132 | |
elinuxhenrik | 4a303fb | 2022-06-29 15:28:23 +0200 | [diff] [blame] | 133 | * maxConcurrency, defines max how many paralell REST calls the consumer wishes to receive. 1, which is default, means sequential. A higher value may increase throughput. |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 134 | |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 135 | |
elinuxhenrik | 4a303fb | 2022-06-29 15:28:23 +0200 | [diff] [blame] | 136 | Below follows examples of some filters. |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 137 | |
| 138 | .. code-block:: javascript |
| 139 | |
| 140 | { |
| 141 | "filterType":"regexp", |
| 142 | "filter": ".*" |
| 143 | } |
| 144 | |
| 145 | |
| 146 | .. code-block:: javascript |
| 147 | |
| 148 | { |
| 149 | "filterType":"jslt", |
| 150 | "filter": "if(.event.commonEventHeader.sourceName == \"O-DU-1122\") .event.perf3gppFields.measDataCollection.measInfoList[0].measValuesList[0].measResults[0].sValue" |
| 151 | } |
| 152 | |
| 153 | |
| 154 | .. code-block:: javascript |
| 155 | |
| 156 | { |
| 157 | "filterType":"json-path", |
| 158 | "filter": "$.event.perf3gppFields.measDataCollection.measInfoList[0].measTypes.sMeasTypesList[0]" |
| 159 | } |
| 160 | |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 161 | Below follows an example of using bufferTimeout and maxConcurrency. |
| 162 | |
| 163 | .. code-block:: javascript |
| 164 | |
| 165 | { |
| 166 | "bufferTimeout":{ |
| 167 | "maxSize":123, |
| 168 | "maxTimeMiliseconds":456 |
| 169 | }, |
| 170 | "maxConcurrency":1 |
| 171 | } |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 172 | |
| 173 | |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 174 | |
| 175 | ===================== |
| 176 | typeSchemaPmData.json |
| 177 | ===================== |
| 178 | This schema will be registered when the configured dataType is "pmData". |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 179 | This will extend the filtering capabilities so that a special filter for PM data can be used. Here it is possible to |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 180 | define which meas-types (counters) to get from which resources. |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 181 | |
PatrikBuhr | ae615c3 | 2022-05-04 14:30:28 +0200 | [diff] [blame] | 182 | The filterType parameter is extended to allow value "pmdata" which can be used for PM data filtering. |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 183 | |
| 184 | * sourceNames an array of source names for wanted PM reports. |
elinuxhenrik | 4a303fb | 2022-06-29 15:28:23 +0200 | [diff] [blame] | 185 | * measObjInstIds an array of meas object instances for wanted PM reports. If a given filter value is contained in the filter definition, it will match (partial matching). |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 186 | For instance a value like "NRCellCU" will match "ManagedElement=seliitdus00487,GNBCUCPFunction=1,NRCellCU=32". |
| 187 | * measTypes selects the meas types to get |
| 188 | * measuredEntityDns partial match of meas entity DNs. |
PatrikBuhr | e0b56b4 | 2022-08-01 13:24:48 +0200 | [diff] [blame^] | 189 | * measObjClass matching of the class of the measObjInstId. The measObjInstId must follow the 3GPP naming conventions for Managed Objects (3GPP TS 32.106-8). |
| 190 | Example, for a distinguished name "ManagedElement=RNC-Gbg-1,ENodeBFunction=1", the MO class will be "ENodeBFunction". |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 191 | |
| 192 | All PM filter properties are optional and a non given will result in "match all". |
| 193 | The result of the filtering is still following the structure of a 3GPP PM report. |
| 194 | |
elinuxhenrik | 4a303fb | 2022-06-29 15:28:23 +0200 | [diff] [blame] | 195 | Below follows an example of a PM filter. |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 196 | |
| 197 | .. code-block:: javascript |
| 198 | |
| 199 | { |
PatrikBuhr | e0b56b4 | 2022-08-01 13:24:48 +0200 | [diff] [blame^] | 200 | "filterType":"pmdata", |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 201 | "filter": { |
| 202 | "sourceNames":[ |
| 203 | "O-DU-1122" |
| 204 | ], |
| 205 | "measObjInstIds":[ |
| 206 | "UtranCell=dGbg-997" |
| 207 | ], |
| 208 | "measTypes":[ |
| 209 | "succImmediateAssignProcs" |
PatrikBuhr | e0b56b4 | 2022-08-01 13:24:48 +0200 | [diff] [blame^] | 210 | ], |
PatrikBuhr | 619bfb3 | 2022-04-20 17:40:05 +0200 | [diff] [blame] | 211 | "measuredEntityDns":[ |
| 212 | "ManagedElement=RNC-Gbg-1" |
| 213 | ] |
| 214 | } |
PatrikBuhr | 4bfffa6 | 2022-06-20 13:16:38 +0200 | [diff] [blame] | 215 | } |