Class MonitoredMicroserviceEnvironmentPostProcessor

java.lang.Object
com.nmontytskyi.monitoring.starter.env.MonitoredMicroserviceEnvironmentPostProcessor
All Implemented Interfaces:
org.springframework.boot.env.EnvironmentPostProcessor

public class MonitoredMicroserviceEnvironmentPostProcessor extends Object implements org.springframework.boot.env.EnvironmentPostProcessor
Registers MonitoredMicroservice annotation attributes as the lowest-priority PropertySource in the application environment.

Running as an EnvironmentPostProcessor guarantees the values are present before any @ConditionalOnProperty, @ConfigurationProperties binding, or @Scheduled fixedDelay resolution takes place. Any application.yml key under the monitoring.* prefix naturally overrides the annotation value because YAML property sources have higher precedence.

Registered via META-INF/spring.factories.

  • Constructor Details

    • MonitoredMicroserviceEnvironmentPostProcessor

      public MonitoredMicroserviceEnvironmentPostProcessor()
  • Method Details

    • postProcessEnvironment

      public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)
      Specified by:
      postProcessEnvironment in interface org.springframework.boot.env.EnvironmentPostProcessor