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 2020/07/06 11:55:29 UTC
[GitHub] [shardingsphere-elasticjob-lite] terrymanu opened a new issue #970: Add spring boot starter
terrymanu opened a new issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970
It is better to add spring boot starter for ElasticJob.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] yu199195 closed issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
yu199195 closed issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] TeslaCN commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-655935902
I am working on it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] TeslaCN commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-654195938
I can make it, please assign to me.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] yu199195 commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-655937082
@TeslaCN you maybe up speed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] jiang2015 commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
jiang2015 commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-656001336
I have done,I want to see the author how to work
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] jiang2015 commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
jiang2015 commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-655934811
I try to write.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] TeslaCN commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-656010022
I have designed some annotations to simplify job definition such as:
```java
@ElasticJob(
jobBootstrapType = JobBootstrapType.SCHEDULE,
jobName = "springBootSimpleJob",
shardingTotalCount = 3,
shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou",
cron = "0/10 * * * * ?"
)
@Tracing("tracingConfig1")
@RegistryCenter("zookeeper1")
public class SpringBootSimpleJob implements SimpleJob {
@Autowired
private FooRepository fooRepository;
@Override
public void execute(ShardingContext shardingContext) {
System.out.println(String.format("Item: %s | Time: %s | Thread: %s | %s",
shardingContext.getShardingItem(), new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "SIMPLE"));
List<Foo> data = fooRepository.findTodoData(shardingContext.getShardingParameter(), 10);
for (Foo each : data) {
fooRepository.setCompleted(each.getId());
}
}
}
```
or
```java
@Bean
@ElasticJob(
jobName = "springBootBeanSimpleJob",
shardingTotalCount = 3,
shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou",
cron = "0/10 * * * * ?",
jobBootstrapType = JobBootstrapType.SCHEDULE)
@Tracing("tracingConfig2")
public SpringBootBeanSimpleJob springBootBeanSimpleJob(FooRepository fooRepository) {
return new SpringBootBeanSimpleJob(fooRepository);
}
```
Configuration:
```yaml
elasticjob:
enabled: true
registryCenter:
zookeeper:
serverLists: 10.105.25.80:2181
namespace: elasticjob
tracing:
type: RDB
spring:
datasource:
url: jdbc:h2:mem:job_event_storage
driver-class-name: org.h2.Driver
username: sa
password:
```
No further configuration is required.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob-lite] ArvinSiChuan commented on issue #970: Add spring boot starter
Posted by GitBox <gi...@apache.org>.
ArvinSiChuan commented on issue #970:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/issues/970#issuecomment-655820500
Count me in if more volunteers are needed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org