Joke Collection Website - Public benefit messages - How to push java messages regularly

How to push java messages regularly

Several methods to realize timing tasks;

Timer: This is the java.util.Timer class that comes with java. This class allows you to schedule the java.util.TimerTask task. Using this method, the program can be executed at a certain frequency, but it can't run at the specified time. Generally used less.

ScheduledExecutorService: it is also a class that comes with jdk;

It is a timed task class based on thread pool design, and each scheduled task will be assigned to a thread in the thread pool for execution, that is, the tasks will be executed concurrently without affecting each other. Spring Task: The task that comes with Spring 3.0 can be regarded as a lightweight Shi Ying, which is much simpler to use than Shi Ying.

Quartz: This is a powerful scheduler, which can make the program execute at a specified time or at a certain frequency, and the configuration is a little more complicated.

Message push recommends Aurora push software. JPush is a large-scale tested App push platform, which pushes tens of billions of messages every day. After developers integrate SDK, they can push messages by calling API. At the same time, JPush provides a visual web console to send notifications and statistically analyze the push effect. JPush fully supports Android, iOS and Winphone.