How to start and stop Job in Spring Integration by annually.

本文介绍如何使用SpringIntegration通过配置SourcePollingChannelAdapter实现作业的启动与停止,并演示了具体的代码实现。
How to start and stop Job in Spring Integration by annually.


<int-jpa:inbound-channel-adapter id="jobBeanID" auto-startup="${auto.start}" entity-manager="em"
send-timeout="${channel.default.timeout}" channel="queryJobListChannel" expect-single-result="true"
jpa-query="SELECT job FROM JobEntity job WHERE job.jobBeanId='abc' ">
<int:poller fixed-delay="${poll.interval}" />
</int-jpa:inbound-channel-adapter>


SourcePollingChannelAdapter spca = (SourcePollingChannelAdapter) context.getBean("jobBeanID");

System.out.println("start the job");

spca.start();

do {
try {
Thread.sleep(5000);
}
catch (InterruptedException e) {
e.printStackTrace();
}

count++;
} while (count < 3);

System.out.println("stop the job");

spca.stop();
1. “World Happiness Report” The World Happiness Report is released annually. It explores and ranks national happiness levels, providing insights into what makes people content in different countries. 2. “public policy” Public policy is crafted by governments to address societal challenges and improve citizens' lives. It includes strategic plans and actionable measures. 3. “GDP per capita” GDP per capita is calculated by dividing a nation's total economic output by its population. It shows the average economic productivity of each individual. 4. “life expectancy” Life expectancy is a key demographic indicator. It estimates the average number of years a person will live in a specific geographic area. 5. “corruption” Corruption is defined as the abuse of authority for personal benefit. It includes illegal acts such as bribery in government or corporate fields. 6. “fuel” (in the text) In the context of the passage, “fuel” is used as a verb meaning to boost or intensify. For example, the report fuels public curiosity about happiness science. 7. “readership” Readership denotes the total audience of a publication, such as a report or journal. It quantifies how many people engage with a given text. 8. “geography” (in the text) In this context, “geography” goes beyond physical landscapes. It describes how happiness is distributed across different global regions. 9. “evaluation” Evaluation involves systematic assessment and judgment. As seen in the report, it helps measure people's satisfaction with their lives. 10. “variable” A variable is a factor that is subject to change. It plays a role in shaping outcomes. In the report, six such variables are identified as key to happiness.转化为可以保存的英语音频
10-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值