Naming Conventions
The names of properties employed in the Configuration Service and ONE 2.0 in general should follow Spring Boot formatting recommendations and use lowercase kebab format where the following applies:
-
Dots (
.
) are used to separate different components of a property name. -
Dashes (
-
) are used when one component of the property name consists of multiple parts. -
Only lowercase characters are accepted.
For example, a property called property-name
in the module module-name would be specified as follows: app.module-name.property-name=value
.
If a property is provided as an environment variable, the following format must be used instead:
-
Underscores (
_
) are used in place of dots (.
). -
Dashes (
-
) are removed and cannot be replaced by another character. -
Only uppercase characters are accepted.
As an environment variable, the previous example would have the following format: APP_MODULENAME_PROPERTYNAME
.
Naming recommendations
To distinguish ONE 2.0 properties from those originating from third-party libraries and frameworks, each property should have a prefix pointing to where the property is defined or consumed. In that regard, it is possible to identify three types of properties.
Module properties
Properties related to one of ONE 2.0 modules, such as AICORE, MMM, DPM, have a prefix in the following format: ataccama.one.${module-name}
.
For example, in the mmm
module, a property called property-name
would be set the following way:
ataccama.one.mmm.property-name = 1
Keep in mind that the same approach applies to properties that are not specific to ONE 2.0, for example: server.port = 8021
.
In Spring Boot framework, the following syntax is used to define a module property:
If a property does not pertain to a single module, it is defined using only the property name:
|
Plugin properties
When configuring plugin properties, in addition to the prefix ataccama.one
, it is necessary to add a prefix identifying that specific plugin: plugin.${plugin-id}
.
The prefix is defined in the plugin framework. For example, in the plugin datasources
, the value of the property property-name
is set as follows:
plugin.datasources.ataccama.one.property-name = 1
If the plugin prefix is omitted (for example, using ataccama.one.property-name = 1
instead of plugin.plugin-id.ataccama.one.property-name = 1
), the property is set for all plugins.
This type of approach, where plugin properties are set globally, should be used rarely and with caution.
In Spring Boot framework, the following syntax is used to define a plugin property:
|
Library properties
Properties used in shared libraries have the prefix ataccama.${lib-name}
, for example:
ataccama.grpc.property-name = 1
If a library is used within a plugin, an additional prefix coming from the plugin framework needs to be included when setting the property value, for example, plugin.plugin-id.ataccama.lib-name.property-name = 1
.
If the plugin is omitted from the prefix, all instances of the library in all plugins are configured at once.
In Spring Boot framework, the following syntax is used to define a library property:
|
Constraints
Constraints are defined using the pattern ataccama.constraints.${constraint-name}
.
The name of the constraint consists of two elements:
-
The name of the package where the constraint is defined as a capability, for example,
com.ataccama.dpe.plugin.dataconnect
, which points to the plugindataconnect
in the DPE module. -
The unqualified name of the constraint, for example,
provider.type
, that is the name of the property without its package information.
In this case, the constraint would be specified the following way:
ataccama.constraints.com.ataccama.dpe.plugin.dataconnect.provider.type
All parts of the constraint name are concatenated using dots (.
).
Configuration example
The following example shows how different types of properties are configured for the MMM module in the file application.properties
.
# configuration of Spring property
server.port = 8021
# configuration of module property
ataccama.one.mmm.drop-first = true
# configuration of library (locks) used by module itself
ataccama.locks.timeout = 10s
# configuration of plugin property
plugin.dpm.ataccama.one.executor.async.pool.size.core = 10
plugin.dpm.ataccama.one.server.host = localhost
# the previous property is accessed as @Value("${ataccama.one.server.host}")
# configuration of library (grpc) used by plugin (dpm)
plugin.dpm.ataccama.grpc.tls = false
# Shared properties
ataccama.one.mmm.host = mmm-host-name
ataccama.one.mmm.http-port = 8008
ataccama.one.mmm.grpc-port = 5321
This example shows how to set manual constraint override in the DPE module.
ataccama.constraints.com.ataccama.dpe.plugin.dataconnect.provider.type=FILESYSTEM,MDA
Was this page useful?