You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/25 02:26:52 UTC

[GitHub] [shardingsphere-elasticjob] CherishCai commented on a diff in pull request #2034: Enhance springboot starter tracing config

CherishCai commented on code in PR #2034:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2034#discussion_r1003935432


##########
elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java:
##########
@@ -30,17 +34,40 @@
  */
 @EnableConfigurationProperties(TracingProperties.class)
 public class ElasticJobTracingConfiguration {
-    
+
+    /**
+     * Create a bean of tracing DataSource.
+     *
+     * @param tracingProperties tracing Properties
+     * @return tracing DataSource
+     */
+    @Bean("tracingDataSource")
+    public DataSource tracingDataSource(final TracingProperties tracingProperties) {

Review Comment:
   现在使用 3.0.2 会由于这里初始化一个 DataSource 影响到了应用启动,因为没设置主要数据源等之类



##########
elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java:
##########
@@ -30,17 +34,40 @@
  */
 @EnableConfigurationProperties(TracingProperties.class)
 public class ElasticJobTracingConfiguration {
-    
+
+    /**
+     * Create a bean of tracing DataSource.
+     *
+     * @param tracingProperties tracing Properties
+     * @return tracing DataSource
+     */
+    @Bean("tracingDataSource")
+    public DataSource tracingDataSource(final TracingProperties tracingProperties) {

Review Comment:
   maybe add a annotation here `@ConditionalOnProperty(name = "elasticjob.tracing.type", havingValue = "RDB")`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org