A lightweight integration of XXL-Job for NodeJS.
-
Completely flexible and composable
The library is designed to be flexible and composable, allowing you to use only the features you need. And you can replace most of the components with other implementations if you want.
-
Glue Types
-
Write your job handler in NodeJS, so it can be called by the XXL-Job server with a specific handler name.
-
Run a NodeJS script in current process, which can be used to run a job handler written in NodeJS.
This allows you to create extra job handlers without the need to change the executor code.
However, this may cause some RCE vulnerabilities if you use untrusted scripts, so be careful when using this feature.
-
Shell Script
Not yet implemented, but will be available in the future.
-
Python Script
Not yet implemented, but will be available in the future.
-
-
Automatically register the executor to the XXL-Job server and keep it alive.
-
Routing strategies
- FAIL_OVER
- BUSY_OVER
-
Log storage (with rotation support)
-
Built-in: MemoryLogManager
Store the logs in memory, which is suitable for development and testing purposes.
-
Built-in: FileLogManager
Store the logs in files, which is suitable for production environments. It supports log rotation based on file creation time.
-
Custom logs storage
You can also implement your own log storage to store the job logs in a persistent way as you want.
-
-
TypeScript v5.0.0 (or newer)
-
Node.js v18.0.0 (or newer)
-
XXL-Job v3.1.0 (or newer)
The lower versions may work, but they are not tested and not guaranteed to work.
npm i @litert/xxl-job-integration --save
- Using
node:http
andFileLogManager
to run a job handler - Using
fastify
andMemoryLogManager
to run a job handler
-
A quick start guide to get you started with the library.
-
The API documentation of the library, including all the classes and methods.
This library is published under Apache-2.0 license.