Joke Collection Website - Blessing messages - Java sends short messages asynchronously. How to achieve asynchronism?

Java sends short messages asynchronously. How to achieve asynchronism?

Java sends short messages asynchronously, which is realized asynchronously;

1, using the asynchronous annotation @Async of the spring framework, the bottom layer should be a thread.

2. Simple and rude way: open a thread.

New thread (new Runnable() {

Public invalid operation () {

//Send SMS

}

}).start();

Of course, you can be more advanced and use thread pools.

3. A little higher: use message queue MQ.