Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package com.springbootdev.samples.springbootasynctask.worker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;
public class AsyncWorker
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncWorker.class);
public void execute()
{" AsyncWorker: current thread [" + Thread.currentThread().getName() + "]");
try {
} catch (InterruptedException ex) {" sleeping thread interrupted ");
}" AsyncWorker: completed [" + Thread.currentThread().getName() + "]");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment