apache / shardingsphere-elasticjob

Distributed scheduled job
Apache License 2.0
8.15k stars 3.29k forks source link

同一个class 注册多任务问题 #398

Closed wgou closed 7 years ago

wgou commented 7 years ago

数据同步会消耗较高的内存. 故想任务拆分为多个时段执行。 但elasticjob 不支持这类方式,请问除了每个任务写一个独立的 class之外,有没有别的解决方式。 因同步模块代码一致,copy成另外一个class 感觉不怎么好。

<job:simple
        id="recipetHeaderJob"
        class="com.retail.vrm.biz.bean.task.RecipetHeaderTask"
        registry-center-ref="retailVrmCenter"
        cron="${job.recipet.cron}"
        sharding-total-count="2"
        sharding-item-parameters="0=300,1=300"
        monitor-execution="true"
        failover="true"
        overwrite="true"/>

<!--6:00 同步华东收货单 -->
<job:simple
        id="recipetHdHeaderJob"
        class="com.retail.vrm.biz.bean.task.RecipetHeaderTask"
        registry-center-ref="retailVrmCenter"
        cron="${job.recipethd.cron}"
        sharding-total-count="2"
        sharding-item-parameters="0=305,1=305"
        monitor-execution="true"
        failover="true"
        overwrite="true"/>

 <!--6:30 同步西北货单 -->
<job:simple
        id="recipetXbHeaderJob"
        class="com.retail.vrm.biz.bean.task.RecipetHeaderTask"
        registry-center-ref="retailVrmCenter"
        cron="${job.recipethd.cron}"
        sharding-total-count="2"
        sharding-item-parameters="0=307,1=307"
        monitor-execution="true"
        failover="true"
        overwrite="true"/>
terrymanu commented 7 years ago

dup with #64 请升级