我想使用Springboot MetricRepository
org.springframework.boot.actuate.metrics.repository.MetricRepository
吐出指標與
private final MetricRepository repository;
@Autowired
public MetricExporterService(MetricRepository repository) {
this.repository = repository;
}
,但由於我使用Java 1.8,我得到
Parameter 0 of constructor in com.example.actuator.MetricExporterService required a bean of type 'org.springframework.boot.actuate.metrics.repository.MetricRepository' that could not be found.
- Bean method 'actuatorMetricRepository' not loaded because @ConditionalOnJava (older than 1.8) found 1.8
是否存在的一種方式壓倒這種行爲?