Uploaded image for project: 'Agroal'
  1. Agroal
  2. AG-223

AutoConfiguration conditional on beans should configure after AutoConfigurations that register these beans

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3
    • 2.3
    • spring
    • None
    • False
    • None
    • False

      With AG-213, a micrometer implementation was added to agroal with an AutoConfiguration. AgroalDataSourcePoolMetricsAutoConfiguration is @ConditionalOnBean(

      {AgroalDataSource.class, MeterRegistry.class}

      ), but it is not explicitly configured after AutoConfigurations that actually register these beans. The @Bean AgroalDataSource is defined in AgroalDataSourceConfiguration and for MeterRegistry-beans, it seems like after org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration is safest.

      Changing @Configuration(proxyBeanMethods = false) to @AutoConfiguration(after =

      {DataSourceAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class}

      ) should work as intended.

              lbarreiro-1 Luis Barreiro
              kimdlanor Ronald Mik (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: