title: WebSphere work manager with Spring @Scheduled
body: <p>How to use the IBM WebSphere work manager together with the Spring <code>@Scheduled</code> annotation in my servlet?</p>
  <p>Spring provides the <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/commonj/WorkManagerTaskExecutor.html" rel="nofollow noreferrer"><code>WorkManagerTaskExecutor</code></a>. It allows to configure a work manager as described <a href="https://www.ibm.com/docs/en/was-nd/8.5.5?topic=framework-thread-management-spring" rel="nofollow noreferrer">in the WebSphere docs</a> or in <a href="https://stackoverflow.com/a/21073991/395879">this SO answer</a>. However I don't see a relation to the <a href="https://www.baeldung.com/spring-scheduled-tasks" rel="nofollow noreferrer"><code>@Scheduled</code></a> annotation and can't find any documentation how it works internally.</p>
  <p>My goal is to configure scheduled tasks in a convenient way (as given by <code>@Scheduled</code>) but I need the task threads created by the scheduler to be managed by WebSphere.</p>
  <p><strong>EDIT:</strong> In the original question I confused <code>DefaultManagedTaskExecutor</code> with <code>WorkManagerTaskExecutor</code> as the latter is deprecated in favor of the first. Now I understand that <code>WorkManagerTaskExecutor</code> is Java EE 6 (and therefore required for our WebSphere 8.5 environment) whereas <code>DefaultManagedTaskExecutor</code> belongs to Java EE 7 and can indeed be configured for <code>@Scheduled</code> which is documented with the <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/EnableScheduling.html" rel="nofollow noreferrer"><code>@EnableScheduling</code></a> annotation.</p>