Configure SchedulerxWorker to control how your application connects to SchedulerX, manages resources, and handles shutdown. This topic lists all available parameters grouped by function, with default values and usage guidance.
Connection parameters
These parameters establish the connection between your application and SchedulerX.
| Parameter | Description | Default value | Required |
|---|---|---|---|
setEndpoint(String endpoint) | The endpoint for a specific region. | None | Yes |
setNamespace(String namespace) | The namespace ID. | None | Yes |
setGroupId(String groupId) | The application ID (group ID). Generated when you create the application in the SchedulerX console. | None | Yes |
Authentication parameters
Authenticate your application with SchedulerX. Use either an AccessKey pair or an appKey, not both.
| Parameter | Description | Default value | Required |
|---|---|---|---|
setAliyunAccessKey(String aliyunAccessKey) | The AccessKey ID of your Alibaba Cloud account. Not required if you use appKey for authentication. | None | Conditional |
setAliyunSecretKey(String aliyunSecretKey) | The AccessKey secret of your Alibaba Cloud account. Not required if you use appKey for authentication. | None | Conditional |
Network parameters
Override auto-detected network settings when your environment requires explicit configuration.
| Parameter | Description | Default value | Required |
|---|---|---|---|
setHost(String host) | The IP address of the application. Set this when the auto-detected IP address is incorrect, such as in environments with multiple network interface cards (NICs) or VPNs. | None | No |
setPort(int port) | The port on which the application listens. | None | No |
Resource pool parameters
Tune resource allocation for concurrent job execution.
| Parameter | Description | Default value | Required |
|---|---|---|---|
setEnableBatchWork(boolean enableBatchWork) | Enables grid computing. See | true | No |
setShareContainerPool(boolean shareConatinerPool) | Allows all jobs in the application to share the same container pool. Enable this when many jobs run concurrently. When enabled, setSharePoolSize controls the pool size. | false | No |
setSharePoolSize(int sharePoolSize) | The size of the shared container pool. Only applies when setShareContainerPool is set to true. | 64 | No |
Scheduling frequency parameters
Fine-tune job scheduling frequency and delay behavior.
| Parameter | Description | Default value | Required |
|---|---|---|---|
setMapMasterStatusCheckInterval(int interval) | The interval, in milliseconds, at which SchedulerX checks whether all tasks are completed in the Map model. Lower values increase the check frequency. Reduce this value to increase the trigger frequency for second-delay jobs. | 3000 | No |
setEnableSecondDelayCycleIntervalMs(boolean enable) | Changes the delay unit for second-delay jobs from seconds to milliseconds in the console. Set to true to increase the trigger frequency for second-delay jobs. | false | No |
Graceful shutdown parameters
Control how the application shuts down. setGraceShutdownMode and setGraceShutdownTimeout work together. Graceful shutdown is disabled by default. To enable it, set both parameters: choose a shutdown mode and set a timeout value greater than 0.
| Parameter | Description | Default value | Required |
|---|---|---|---|
setGraceShutdownMode(String mode) | The graceful shutdown mode. Valid values: WAIT_ALL (the application closes only after all received jobs and tasks complete) and WAIT_RUNNING (the application closes after running jobs and tasks that have allocated threads complete). | None (disabled) | No |
setGraceShutdownTimeout(long delay) | The shutdown grace period in seconds. If not set or set to a value less than or equal to 0, graceful shutdown does not take effect, even when setGraceShutdownMode is configured. | None | No |
Advanced parameters
| Parameter | Description | Default value | Required |
|---|---|---|---|
setBlockAppStart(boolean block) | Blocks the application process from starting if SchedulerX fails to complete initialization. | None | No |
setClassLoader(ClassLoader userClassLoader) | A custom class loader. May be required for non-Spring applications that use a third-party framework. | None | No |
setLabel(String label) | Labels added to the application at startup. Use labels to designate specific workers for job scheduling. Suitable for canary release and stress testing scenarios. | None | No |
setSlsCollectorEnable(boolean enable) | Enables Simple Log Service (SLS) log collection. | true | No |
Grid computing guidance
The setEnableBatchWork parameter controls grid computing and defaults to true.
If your application does not use grid computing, set
setEnableBatchWorktofalse.If your application uses grid computing, keep the default value of
true. Setting it tofalsecauses the first job trigger on each worker to be delayed by at least 20 seconds.
Parameter dependencies
Some parameters depend on each other. Configure them together to avoid unexpected behavior.
| Parameter | Depends on | Relationship |
|---|---|---|
setSharePoolSize | setShareContainerPool | setSharePoolSize only takes effect when setShareContainerPool is true. |
setGraceShutdownTimeout | setGraceShutdownMode | Both must be set for graceful shutdown to work. The timeout must be greater than 0. |
setAliyunAccessKey | setAliyunSecretKey | Always set both together. Not required if you use appKey for authentication. |