Spring task scheduler + jboss

I have strange behavior with spring task scheduling on jboss 6.3.0.GA. I don't know why every time the task is run in jboss it is run twice at the same time, in tomcat only once.

<task:scheduler id="taskScheduler" pool-size="1"/>
    <task:scheduled-tasks scheduler="taskScheduler">
        <task:scheduled ref="jobListener" method="pickUpChanges" cron="*/5 * * * * ?"/>
</task:scheduled-tasks>

      

spring.version: 3.1.1.RELEASE

Any help?

+3


source to share


1 answer


You can't have scheduler and fixed delay corn expressions by removing one of them.

<task:scheduled ref="jobListener" method="pickUpChanges" cron="*/5 * * * * ?"/>

      

or



<task:scheduled ref="jobListener" method="pickUpChanges" fixed-delay="3000"/>

      

See the link for details. Long story short, in your case, two triggers are fired, one for a fixed delay and the other for a cron expression, which results in the method executing twice.

0


source







All Articles