1. The @enableAsync annotation is required on the startup class

2. To call a Service, place the @async annotation on the Service implementation class.Add @async annotation. Pay special attention to returning Futrue here. If you want to return a result, you can only use the Future.

  1. The Controller calls

IsDone indicates that the command is executed successfully.

If you don’t call a Service, you can simply add the @async annotation to the method.If multiple asynchronous methods are executed:

Stomp: Controller returns a value of another type, and the front-end request reports an exception to the server. Change Future to normal.