Is it possible to schedule Spring service method only once at exactly specified time? For example, current time is 2pm but when I hit the action button I want that my servic
In order to not create ScheduledExecutorService and ConcurrentTaskScheduler at every method call it is convenient to initialize TaskScheduler at service creation, e.g.
private final TaskScheduler taskScheduler =
new ConcurrentTaskScheduler(Executors.newScheduledThreadPool(10));
@Async has no sense as we just schedule task and exit from method.