我将Spring Batch和Spring Integration结合在一起,我使用的是poller和玉米:
@Bean
@SchedulerLock(name = "importEntitiesRiskCodes", lockAtMostForString = "PT5M")
public IntegrationFlow integrationFlow() {
return IntegrationFlows.from(fileReadingMessageSource(),
c -> c.poller(Pollers.cron("0-7 1-59/5 * * * ?").maxMessagesPerPoll(maxFilesPerPoll)))
.channel(fileIn())
.transform(fileMessageToJobrequest())
.handle(jobLaunchingGateway())
.log()
.get();
}我知道Spring Integration JDBC提供了JDBCLockRepository,但我想知道如何使用ShedLock。
发布于 2021-01-22 22:30:01
从你的描述中根本不清楚你将如何使用这个锁,但是根据这个article,看起来没有任何与Spring Integration相关的东西。
另一方面,即使我不熟悉这个库,将ShedLock的LockRegistry实现添加到Spring Integration中看起来也不错。尽管它可能与您的任务无关...
https://stackoverflow.com/questions/65845133
复制相似问题