English 中文(简体)
春季任务 安排太多的任务
原标题:Spring Task Executor Scheduled too many instances of the task

我有一个简单明了的“普惠制”指标:

<context:component-scan base-package="com/test"/>
<task:scheduled-tasks>
    <task:scheduled ref="myScheduler" method="doMyTask" fixed-rate="300000"/>
</task:scheduled-tasks>

<task:scheduler id="taskScheduler" pool-size="1"/>

<task:executor id="executorWithPoolSizeRange"
               pool-size="1"
               queue-capacity="100"/>

<bean id="cleanupClass" class="com.test.CleanupClass">
   <property name="myProperty" value="3600"/>
</bean>

我每5分钟就座一只read。 然而,我所看到的是,任务连续每5分钟一次。 是否有任何人知道在上文XML描述中是否有任何遗漏?

我指的是我想用“后附说明”来做的,但我不使用固定汇率的说明,因为我想在《守则》之外可以证明这一点。

感谢。

问题回答

我的工作如下:

  <bean id="task" class="com.foo.MyTask">
  <task:scheduled-tasks scheduler="scheduler">
    <task:scheduled ref="task" method="run" fixed-delay="300000" />
  </task:scheduled-tasks>
  <task:scheduler id="scheduler" pool-size="10" />

Greetings, Mark

当你部署时,你在安全总局看到这种行为吗? 如果是的话,你将不开发申请,重新调配申请,重新启动申请。

另一种想法是从财产档案中使用SPEL表达方式,用@Stor annotation加以使用。 这样,在使用这一说明时,它仍然可以想象。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签