title: Can't Schedule task in Spring Boot without passing parameters to @Scheduled annotated method
body: <p>I would like allow users to make periodic orders in an Ecommerce application, for example every week, every two weeks. I used the @Scheduled annotation, however, the annotated function cannot take arguments or have a return value.</p>
  <p>Are there are any other alternatives or solutions to this issue?</p>
  <pre><code>@PostMapping(value=&quot;/period&quot;)
  @Scheduled(fixedRate = 20000)
  public ResponseEntity&lt;Long&gt; insertPeriodic(@Valid @RequestBody NewOrderDTO newOrderDTO){
      Order order = orderService.insert(newOrderDTO);
      URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path(&quot;/{id}&quot;).buildAndExpand(order.getId()).toUri();
      return ResponseEntity.created(uri).body(order.getId());
  }
  </code></pre>