Required Prerequisites
APM Configuration
The DLC relies on APM’s IHealthEventDispatcher
to dispatch HealthEvents as well as Trace the HealthEvents by using a TraceContext. To ensure APM and its Tracing components are configured correctly the following configurations will need to be implemented into your project.
Required Configuration Classes
Required Configuration Classes | Replaces Configuration Class |
---|---|
TracingConfig.class |
N/A |
ServicesConfigBeanPostProcessor.class |
ActivePivotServicesConfig |
An example of including these configuration classes can be seen as follows:
@Configuration
@Import({
// Required Configurations for Tracing and APM
TracingConfig.class,
ServicesConfigBeanPostProcessor.class
})
public class ApplicationConfig {
}
Active Pivot Registry Configuration
APM must be defined with high precedence in ActivePivot’s Registry
. This is because some classes are Extended Plugins or Types overriding the core code. It is important to make sure they are picked first by the Registry. Make sure you add the package com.activeviam.apm
to be picked first. The below example can be added to your applications configuration.
/** Before anything else we statically initialize the ActiveViam Registry. */
static {
Registry.setContributionProvider(
new ClasspathContributionProvider(
"com.activeviam.apm", // First has highest priority
"com.qfs",
"com.quartetfs",
"com.activeviam"
)
);
}
Bean Initial Data Loading
If you are executing any DLC tasks via Spring Beans during initialization of your application, you must ensure that the APM_TRACING
bean is created first. The APM_TRACING
bean is required to be created before any data loading. The bean is created inside of TracingConfig
. If this bean has not been created before data loading, then the Tracing provided by APM will not work and this can result in null Tracing values. You can ensure the APM_TRACING
bean is created first by either the @DependsOn
annotation or by Autowiring the APM_TRACING
bean. Please see the code sample below as an example:
@Bean
@DependsOn(value = {APM_TRACING})
public Void initialLoad() {
// Load data here...
}