This topic describes two methods for hosting XXL-JOB jobs in job scheduling: using the XXL-JOB version and the SchedulerX version. For XXL-JOB, we strongly recommend using the highly compatible XXL-JOB instance version.
Xxl-job version
Introduction
The XXL-JOB instance version of job scheduling is now in public preview. This version uses SchedulerX as the kernel and is compatible with the XXL-JOB network layer protocol. It provides a non-intrusive solution for hosting XXL-JOB clients. We strongly recommend that new users use the XXL-JOB instance version to better experience our job scheduling service.
Schedulerx version
Introduction
By importing schedulerx2-plugin-xxljob in your pom file, you can make your application compatible with the XXL-JOB SDK interface. Without modifying a single line of code, you can host XXL-JOB clients on SchedulerX. This supports both the @XxlJob
annotation and the JobHandler
class interface methods.
Benefits
Free O&M and cost-effectiveness
A self-hosted XXL-JOB requires at least two servers and one database. Hosting XXL-JOB on SchedulerX can save you machine costs and O&M costs.
Compatible upgrades
Different versions of XXL-JOB are not compatible with each other. When you upgrade the SDK version, you often need to refactor your business code to adapt to the new version. SchedulerX 2.0 offers excellent compatibility advantages. It seamlessly integrates with interfaces and annotation systems of various XXL-JOB versions, ensuring that users do not need to modify their existing business code during any SDK upgrade process.
Massive jobs and precise scheduling
The open-source XXL-JOB uses distributed database locks to ensure that only one node executes a job, which puts pressure on the database. Statistics show that the response latency affects user experience when XXL-JOB processes more than 10,000 jobs at a minute granularity. The response latency is even higher when XXL-JOB processes jobs at a second granularity.
SchedulerX 2.0 uses a distributed architecture. SchedulerX 2.0 schedules different jobs to different workers and prevents processes from competing for locks. SchedulerX 2.0 supports horizontal scaling and scheduling of millions of jobs. SchedulerX 2.0 uses a dedicated architecture that consumes few resources to ensure low latency for jobs that need to be triggered at a second granularity. SchedulerX 2.0 is suitable for real-time workloads that need to run jobs at a second granularity. SchedulerX 2.0 also supports one-time jobs. You can use SchedulerX 2.0 to run a one-time job at a specific point in time. After SchedulerX 2.0 completes the job, the job is automatically deleted. You can use one-time jobs to send notifications or close orders at a scheduled point in time.
Rich visualization capabilities
View user dashboard
View job history
View user operation logs
View job execution stacks
View job operation records
Advanced features
Job orchestration
You can orchestrate jobs by using directed acyclic graph (DAGs), and perform operations on the frontend by dragging nodes. In the detailed DAG of jobs, you can easily obtain the status of jobs and identify the reasons for downstream execution failures.
Rate limiting
SchedulerX 2.0 is commonly used to process offline report jobs at night. For example, many report jobs are started at 1:00:00 or 2:00:00 in the morning. To control the maximum number of concurrent jobs running on an application and ensure service continuity, jobs that exceed the concurrency threshold wait in a queue. Key performance indicator (KPI) reports must be complete before 09:00:00 in the morning. In this case, you can assign a higher priority to KPI report jobs to preempt lower-priority jobs in the scheduling process.
SchedulerX 2.0 allows jobs in a preemptible queue to be preempted by jobs that have a higher priority. You can configure this feature in the console.
Resource isolation
SchedulerX 2.0 allows you to isolate resources by namespace or application. SchedulerX 2.0 also supports permission management in multi-tenant scenarios.
Commercialized alerting and O&M
Alerting
Alert notifications for job execution failures, timeouts, and no available workers are sent by using emails, DingTalk messages, text messages, or phone calls. You can check the causes of failures based on the content of the alerts.
O&M operations
SchedulerX 2.0 allows you to rerun jobs, update the outputs of jobs, mark jobs as complete, view stacks, terminate jobs, and specify machines for a job.