title: Spring task executor and scheduler
body: <p>I wasn't able to find necessary information, neither in documentation or in already existing questions here, that's why I'm creating one myself (I can't ask questions under similar posts yet).</p>
  
  <p>What I need to know is relationship between Spring task executor and scheduler.
  My current configuration looks like this:</p>
  
  <pre><code>&lt;task:executor
          id="executor"
          pool-size="1-2"
          queue-capacity="50"
          rejection-policy="CALLER_RUNS"
  /&gt;
  &lt;task:scheduler id="scheduler" pool-size="2"/&gt;
  
  &lt;task:scheduled-tasks scheduler="scheduler"&gt;
      &lt;task:scheduled ref="task1" method="methodInTask1" cron="0 1/5 * ? * *"/&gt;
      &lt;task:scheduled ref="task2" method="methodInTask2" cron="0 0/5 * ? * *"/&gt;
  &lt;/task:scheduled-tasks&gt;
  </code></pre>
  
  <p>What I'm not sure is how it works. "Who" does run my tasks? Is it scheduler, as task are scheduled with him? Or scheduler is only creating them, placing in queue and excutor runs them?</p>
  
  <p>If not, and the running one is scheduler, I have to create annotations above specific classes and their methods, so that they can be launched by executor? </p>
  
  <p>There is no clear explanation to how they are related, in documentation, neither is for "pool-size", but it can be found in others questions at least. If it's scheduler who runs the tasks is executor in this configuration redundant?</p>