Customizing Pragma Engine #
Customization is central to Pragma Engine’s architecture.
Configuration #
Pragma has a dynamically reloadable configuration system, allowing users to configure a running platform without requiring a restart.
The platform start-up parameters accept a list of config files. These files are read in from disk and periodically polled for changes. All defined config parameters must be supplied either as a baked-in default or through a configuration file, otherwise the platform will fail to start.
Config Overrides and Priority #
The priority for configuration overrides is:
- Higher priority: the list of config files (i.e.
common.yml
,shard/test.yml
) - Lower priority: code level defaults
Config defaults can be specified in code where the configuration values are defined, with the option to specify defaults for development or production. These defaults are overridden if the config value is specified in a higher priority format.
Having a list of configuration files allows you to define a common configuration (i.e. common.yml
) shared between all deployments of Pragma Engine while having specific configuration files for specific deployments.
Dynamic Config #
The platform periodically checks the config files for changes, and loads them if found. Not all configuration is safe to be dynamically reloaded, such as changing to a different database host. In these cases a service restart will be required.
Plugins and Extension Data #
Plugins and Extension Data are the backbone of Pragma Engine customization. They allow users to implement rich features with custom data and logic within the full fledged capabilities of the engine.
Plugins provide a way for developers to inject their own code into Pragma Engine-authored services. They can be configuration-free or configurable.
Extension Data is closely tied to plugins and provide a standard way for users to define custom structured data within the engine.
For more information on Plugins and Extension Data, visit the Plugins and Extension Data page.
Custom Services #
Custom Services are defined in the same manner as engine services and follow the same exact patterns. Custom services adopt all engine features such as Gateway routing, Authentication, Service-to-Service calls, and Telemetry. Custom Services can define and support configuration in the same way Pragma Engine services are configured.
For more information about Custom Services, check out the Custom Services landing page.