From a3e96a683452723a8932d35dfa716dd6d51c0877 Mon Sep 17 00:00:00 2001 From: Jay Zhou <4192339+jaychoww@users.noreply.github.com> Date: Mon, 29 Jul 2024 01:06:14 +0800 Subject: [PATCH] fix: Tracing is incompatible with Spring Boot 3.2.x #2401 (#2405) * fix: Tracing is incompatible with Spring Boot 3.2.x #2401 * chore: pass the code formatting validation --------- Co-authored-by: Jay Chow <4192339+westarest@users.noreply.github.com> --- .../spring/boot/tracing/ElasticJobTracingConfiguration.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index 999250095..6ed0edfba 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -20,6 +20,7 @@ import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; @@ -68,7 +69,8 @@ public DataSource tracingDataSource(final TracingProperties tracingProperties) { */ @Bean @ConditionalOnBean(DataSource.class) - public TracingConfiguration tracingConfiguration(final DataSource dataSource, @Nullable final DataSource tracingDataSource) { + public TracingConfiguration tracingConfiguration(@Qualifier("dataSource") final DataSource dataSource, + @Qualifier("tracingDataSource") @Nullable final DataSource tracingDataSource) { return new TracingConfiguration<>("RDB", null == tracingDataSource ? dataSource : tracingDataSource); } }