2 // ============LICENSE_START=======================================================
3 // Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 // ================================================================================
5 // This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
6 // Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
8 // SPDX-License-Identifier: CC-BY-4.0
9 // ============LICENSE_END=========================================================
11 // @author Sven van der Meer (sven.van.der.meer@ericsson.com)
14 == Configure AVRO Schema Handler
16 The AVRO schema handler is added to the configuration as follows:
20 "engineServiceParameters":{
23 "parameterClassName" : "org.onap.policy.apex.context.parameters.ContextParameters",
26 "parameterClassName" :
27 "org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters"
35 Using the AVRO schema handler has one limitation: AVRO only supports field names that represent valid Java class names.
36 This means only letters and the character `_` are supported.
37 Characters commonly used in field names, such as `.` and `-`, are not supported by AVRO.
38 for more information see link:https://avro.apache.org/docs/1.8.1/spec.html#names[Avro Spec: Names].
40 To work with this limitation, the APEX Avro plugin will parse a given AVRO definition and replace _all_ occurrences of `.` and `-` with a `_`.
43 - In a policy model, if the AVRO schema defined a field as `my-name` the policy logic should access it as `my_name`
44 - In a policy model, if the AVRO schema defined a field as `my.name` the policy logic should access it as `my_name`
45 - There should be no field names that convert to the same internal name
46 ** For instance the simultaneous use of `my_name`, `my.name`, and `my-name` should be avoided
47 ** If not avoided, the event processing might create unwanted side effects
48 - If field names use any other not-supported character, the AVRO plugin will reject it
49 ** Since AVRO uses lazy initialization, this rejection might only become visible at runtime