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/05/24 16:49:33 UTC

[GitHub] [shardingsphere-elasticjob] wallfacers opened a new issue, #2089: ShardingItemParameters and shardingTotalCount in the spring-boot project do not take effect

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

   spring-boot:2.7.0
   elasticjob-lite-spring-boot-starter: 3.0.1
   
   application.properties:
   elasticjob.jobs.simpleJob.elastic-job-class=com.elastic.job.example.elasticjob.MyElasticJobSimpleJob
   elasticjob.jobs.simpleJob.cron=0/5 * * * * ?
   elasticjob.jobs.simpleJob.timeZone=GMT+08:00
   elasticjob.jobs.simpleJob.shardingTotalCount=5
   elasticjob.jobs.simpleJob.shardingItemParameters=0=Beijing,1=Guangzhou,3=Hangzhou2
   
   
   MyElasticJobSimpleJob: 
   `public class MyElasticJobSimpleJob implements SimpleJob {
   
       @Override
       public void execute(ShardingContext shardingContext) {
           try {
               System.out.println("当前时间:" + LocalDateTime.now().format(
                       DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + ", 当前上下文: "
                       + new JsonMapper().writeValueAsString(shardingContext));
           } catch (JsonProcessingException e) {
               e.printStackTrace();
           }
       }
   }`
   
   The effect:
   
   
   ![屏幕截图 2022-05-25 004815](https://user-images.githubusercontent.com/26599681/170089657-8f2b898a-4fad-4fb7-9778-08801d8571f3.png)
   
   
   


-- 
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] TeslaCN commented on issue #2089: ShardingItemParameters and shardingTotalCount in the spring-boot project do not take effect

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #2089:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2089#issuecomment-1139371462

   Hi @wallfacers 
   Could you check the configuration in ZooKeeper? You may need to set `overwrite: true` to change configurations in ZooKeeper.


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


[GitHub] [shardingsphere-elasticjob] cocodroid commented on issue #2089: ShardingItemParameters and shardingTotalCount in the spring-boot project do not take effect

Posted by GitBox <gi...@apache.org>.
cocodroid commented on issue #2089:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2089#issuecomment-1140743625

   @wallfacers you can use zkCli command get shardingItemParameters config.
   ` get /elasticjob-lite-springboot/simpleJob/config `


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