blob: 1174e44ece8b3265b6805cfdd48f428b00e9e234 [file] [log] [blame]
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +02001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. SPDX-License-Identifier: CC-BY-4.0
PatrikBuhr619bfb32022-04-20 17:40:05 +02003.. Copyright (C) 2022 Nordix
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +02004
5
6DMaaP Adapter
7~~~~~~~~~~~~~
8
PatrikBuhr619bfb32022-04-20 17:40:05 +02009************
10Introduction
11************
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020012
PatrikBuhr4bfffa62022-06-20 13:16:38 +020013This 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.
14The information can be filtered, transformed, aggregated and then delivered to data consumers using REST calls (POST) or via Kafka.
PatrikBuhr619bfb32022-04-20 17:40:05 +020015
16The DMaaP Adapter registers itself as an information producer along with its information types in Information Coordination Service (ICS).
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020017The information types are defined in a configuration file.
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020018
PatrikBuhr619bfb32022-04-20 17:40:05 +020019A 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.
20This service will get data from DMaaP MR or Kafka topics and deliver it to the data consumers based on their created subscription jobs.
21
22So, a data consumer may be decoupled from DMaaP and/or Kafka this way.
23
24The service is implemented in Java Spring Boot (DMaaP Adapter Service).
25
26.. image:: ./Architecture.png
27 :width: 500pt
28
elinuxhenrik873c5b92022-06-23 10:37:43 +020029This product is a part of :doc:`NONRTRIC <nonrtric:index>`.
30
PatrikBuhr4bfffa62022-06-20 13:16:38 +020031*************
32Data Delivery
33*************
elinuxhenrik4a303fb2022-06-29 15:28:23 +020034When 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.
PatrikBuhr4bfffa62022-06-20 13:16:38 +020035After 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
40The output will be the same regardless if the information is received from DMaaP of from Kafka. If the data is not buffered/aggregated,
41and the output is a Kafka Stream, both the keys and the values are forwarded (after filtering/transformation).
elinuxhenrik4a303fb2022-06-29 15:28:23 +020042If the output is HTTP, only the the values are forwarded (in the HTTP body).
PatrikBuhr4bfffa62022-06-20 13:16:38 +020043
44****************
45Data Aggregation
46****************
47When an Information Job is created, a bufferTimeout can be defined for aggregation of information.
48If this feature is used, the subscribed data will be buffered and will be delivered in chunks.
49
50The 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.
51If 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
PatrikBuhr619bfb32022-04-20 17:40:05 +020053******************
54Configuration File
55******************
56
57The configuration file defines which DMaaP and Kafka topics that should be listened to and registered as subscribeable information types.
58There is an example configuration file in config/application_configuration.json
59
60Each 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.
PatrikBuhrae615c32022-05-04 14:30:28 +020069 This parameter is only relevant if a HTTPproxy is configured in the application.yaml file.
PatrikBuhr619bfb32022-04-20 17:40:05 +020070
71* dataType, this can be set to "pmData" which gives a possibility to perform a special filtering of PM data.
72
PatrikBuhr2b459a12022-06-08 10:12:00 +020073* 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
PatrikBuhr619bfb32022-04-20 17:40:05 +020080These 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
82Below 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",
PatrikBuhr2b459a12022-06-08 10:12:00 +020091 "useHttpProxy": true,
92 "isJson" : true
PatrikBuhr619bfb32022-04-20 17:40:05 +020093 },
94 {
95 "id": "KafkaInformationType",
96 "kafkaInputTopic": "TutorialTopic",
97 },
98 {
99 "id": "PmInformationType",
100 "dmaapTopicUrl": "/dmaap-topic-2",
PatrikBuhr2b459a12022-06-08 10:12:00 +0200101 "dataType": "PmData",
102 "isJson" : true
PatrikBuhr619bfb32022-04-20 17:40:05 +0200103 }
104 ]
105 }
106
107**************************
108Information Job Parameters
109**************************
110
111When an information consumer creates an information job,it can provide type specific parameters. The allowed parameters are defined by a Json Schema.
112The following schemas can be used by the component (are located in dmaapadapter/src/main/resources):
113
PatrikBuhrae615c32022-05-04 14:30:28 +0200114===============
115typeSchema.json
116===============
117This schema will by default be registerred for the type. The following properties are defined:
PatrikBuhr619bfb32022-04-20 17:40:05 +0200118
PatrikBuhr4bfffa62022-06-20 13:16:38 +0200119* 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
PatrikBuhr619bfb32022-04-20 17:40:05 +0200121* 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.
PatrikBuhrae615c32022-05-04 14:30:28 +0200128* 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
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200133* 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.
PatrikBuhrae615c32022-05-04 14:30:28 +0200134
PatrikBuhr619bfb32022-04-20 17:40:05 +0200135
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200136Below follows examples of some filters.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200137
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
PatrikBuhrae615c32022-05-04 14:30:28 +0200161Below 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 }
PatrikBuhr619bfb32022-04-20 17:40:05 +0200172
173
PatrikBuhrae615c32022-05-04 14:30:28 +0200174
175=====================
176typeSchemaPmData.json
177=====================
178This schema will be registered when the configured dataType is "pmData".
PatrikBuhr619bfb32022-04-20 17:40:05 +0200179This will extend the filtering capabilities so that a special filter for PM data can be used. Here it is possible to
PatrikBuhrae615c32022-05-04 14:30:28 +0200180define which meas-types (counters) to get from which resources.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200181
PatrikBuhrae615c32022-05-04 14:30:28 +0200182The filterType parameter is extended to allow value "pmdata" which can be used for PM data filtering.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200183
184* sourceNames an array of source names for wanted PM reports.
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200185* 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).
PatrikBuhr619bfb32022-04-20 17:40:05 +0200186 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.
PatrikBuhre0b56b42022-08-01 13:24:48 +0200189* 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".
PatrikBuhr619bfb32022-04-20 17:40:05 +0200191
192All PM filter properties are optional and a non given will result in "match all".
193The result of the filtering is still following the structure of a 3GPP PM report.
194
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200195Below follows an example of a PM filter.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200196
197.. code-block:: javascript
198
199 {
PatrikBuhre0b56b42022-08-01 13:24:48 +0200200 "filterType":"pmdata",
PatrikBuhr619bfb32022-04-20 17:40:05 +0200201 "filter": {
202 "sourceNames":[
203 "O-DU-1122"
204 ],
205 "measObjInstIds":[
206 "UtranCell=dGbg-997"
207 ],
208 "measTypes":[
209 "succImmediateAssignProcs"
PatrikBuhre0b56b42022-08-01 13:24:48 +0200210 ],
PatrikBuhr619bfb32022-04-20 17:40:05 +0200211 "measuredEntityDns":[
212 "ManagedElement=RNC-Gbg-1"
213 ]
214 }
PatrikBuhr4bfffa62022-06-20 13:16:38 +0200215 }