You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zhangethan (via GitHub)" <gi...@apache.org> on 2023/06/12 02:26:54 UTC

[GitHub] [shardingsphere-elasticjob] zhangethan opened a new issue, #2230: ElasticJobConfiguration doesn't support tracing

zhangethan opened a new issue, #2230:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2230

   ## Bug Report
   
   
   SpringBoot 2.3.12
   elasticjob-lite-spring-boot-starter 3.0.3
   
   When I setup a job by yaml, it can work properly and insert some tracing records.
   ~~~yaml
   elasticjob:
     reg-center:
       server-lists: localhost:2181
       namespace: test
     tracing:
       type: RDB
     jobs:
       testJob1:
         cron: "0/10 * * * * ?"
         elastic-job-class: org.example.Task1
         sharding-total-count: 1
         overwrite: true
         monitorExecution: true
   ~~~
   ~~~java
   @Slf4j
   @Component
   public class Task1 implements SimpleJob {
   
       @Override
       public void execute(ShardingContext shardingContext) {
           log.info("task1: {}", shardingContext);
       }
   }
   ~~~
   But we are upgrading elasticjob from 2.x to 3.x, and we have many jobs using @ElasticSimpleJob, so I'm going to replace @ElasticSimpleJob with @ElasticJobConfiguration, just like :
   ~~~yaml
   elasticjob:
     reg-center:
       server-lists: localhost:2181
       namespace: test
     tracing:
       type: RDB
   ~~~
   ~~~java
   @SpringBootApplication
   @ElasticJobScan("org.example")
   public class App1
   {
       public static void main( String[] args )
       {
           SpringApplication.run(App1.class, args);
       }
   }
   
   @ElasticJobConfiguration(jobName = "testJob1", shardingTotalCount = 1,
           cron = "0/10 * * * * ?", overwrite = true)
   @Slf4j
   public class Task1 implements SimpleJob {
   
       @Override
       public void execute(ShardingContext shardingContext) {
           log.info("task1: {}", shardingContext);
       }
   }
   
   ~~~
   
   ### Expected behavior
   The job can be scheduled properly and it can insert tracing records into RDB
   
   ### Actual behavior
   It can't insert tracing records.
   
   ### Reason analyze (If you can)
   It seems that the job created by @ElasticJobConfiguration isn't compatible with the global tracing configuration.
   ~~~java
       //JobScheduler.findTracingConfiguration can't the global tracing configuration
       private Optional<TracingConfiguration<?>> findTracingConfiguration() {
           return this.jobConfig.getExtraConfigurations().stream().filter((each) -> {
               return each instanceof TracingConfiguration;
           }).findFirst().map((extraConfig) -> {
               return (TracingConfiguration)extraConfig;
           });
       }
   ~~~
   ### Steps to reproduce the behavior.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.apache.org

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


[GitHub] [shardingsphere-elasticjob] linghengqian commented on issue #2230: ElasticJobConfiguration doesn't support tracing

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #2230:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2230#issuecomment-1726275336

   - Would you like to file a PR on this?


-- 
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