Add @Primary to default InMemoryMetricRepository if there is one

This commit is contained in:
Dave Syer 2015-04-28 10:34:55 +01:00 committed by Andy Wilkinson
parent 2aaf556a1c
commit a32c530c36

View File

@ -47,6 +47,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.messaging.MessageChannel;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@ -158,6 +159,7 @@ public class MetricRepositoryAutoConfiguration {
static class LegacyMetricRepositoryConfiguration {
@Bean
@Primary
public InMemoryMetricRepository actuatorMetricRepository() {
return new InMemoryMetricRepository();
}