如何在springxd模块中使用调度
我正在从事一个项目,该项目必须实现以下功能:如何在springxd模块中使用调度,spring,spring-boot,spring-integration,spring-xd,Spring,Spring Boot,Spring Integration,Spring Xd,我正在从事一个项目,该项目必须实现以下功能: 扫描文件夹,获取新添加的文件名 给定一个固定的时间,作业将按计划执行 我目前正在使用spring BOOT,该模块的目标是SpringXD 我想在这个模块中使用Spring调度 谢谢你给我一个描述或任何我能读到的资料。谢谢我现在正在使用spring集成的ftp入站适配器来实现这些功能。 这是为那些来到这里寻求答案的人准备的。我现在正在使用spring集成的ftp入站适配器来实现这些功能。 这是为那些来到这里寻求答案的人准备的。为了启用调度,需要一个调
谢谢你给我一个描述或任何我能读到的资料。谢谢我现在正在使用
spring集成的ftp入站适配器
来实现这些功能。
这是为那些来到这里寻求答案的人准备的。我现在正在使用spring集成的ftp入站适配器来实现这些功能。
这是为那些来到这里寻求答案的人准备的。为了启用调度,需要一个调度程序:
实际上,启用调度非常容易。
使用注释时,您需要做的是:
在配置类中添加@EnableScheduling:
@Configuration
@EnableAsync
@EnableScheduling
public class AppConfig {
}
并且,在您选择的bean中,在方法上方添加以下注释:
@Scheduled(fixedDelay=5000)
如果您需要外部XML配置:
将以下内容添加到xml配置文件中
<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
<task:executor id="myExecutor" pool-size="5"/>
<task:scheduler id="myScheduler" pool-size="10"/>
然后指出要计划的方法:
<task:scheduled-tasks scheduler="myScheduler">
<task:scheduled ref="beanA" method="methodA" fixed-delay="5000"/>
</task:scheduled-tasks>
其他有效资源:
或
要启用计划,需要一个计划程序:
实际上,启用调度非常容易。
使用注释时,您需要做的是:
在配置类中添加@EnableScheduling:
@Configuration
@EnableAsync
@EnableScheduling
public class AppConfig {
}
并且,在您选择的bean中,在方法上方添加以下注释:
@Scheduled(fixedDelay=5000)
如果您需要外部XML配置:
将以下内容添加到xml配置文件中
<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
<task:executor id="myExecutor" pool-size="5"/>
<task:scheduler id="myScheduler" pool-size="10"/>
然后指出要计划的方法:
<task:scheduled-tasks scheduler="myScheduler">
<task:scheduled ref="beanA" method="methodA" fixed-delay="5000"/>
</task:scheduled-tasks>
其他有效资源:
或
谢谢,Lore,即使我在使用ftp适配器,我对它的很多特性也不满意。所以你的建议对我会有很大的帮助,我希望我的应用程序更灵活。很高兴我帮了忙,我的项目中也需要这个。谢谢,Lore,即使我使用ftp适配器,我对它的很多特性都不满意。所以你的建议对我会有很大帮助,我希望我的应用程序更灵活。很高兴我帮了忙,我的项目中也需要这个。