首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Spring Integration中使用ShedLock?

如何在Spring Integration中使用ShedLock?
EN

Stack Overflow用户
提问于 2021-01-22 20:23:50
回答 1查看 130关注 0票数 0

我将Spring Batch和Spring Integration结合在一起,我使用的是poller和玉米:

代码语言:javascript
复制
@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。

EN

回答 1

Stack Overflow用户

发布于 2021-01-22 22:30:01

从你的描述中根本不清楚你将如何使用这个锁,但是根据这个article,看起来没有任何与Spring Integration相关的东西。

另一方面,即使我不熟悉这个库,将ShedLock的LockRegistry实现添加到Spring Integration中看起来也不错。尽管它可能与您的任务无关...

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65845133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档