SchedulerxWorker configuration parameters

更新时间:
复制 MD 格式

Configure the SchedulerxWorker agent to connect your Java application to SchedulerX and control its runtime behavior. Start with the required connection parameters, then adjust optional settings as needed.

Connection

These parameters establish the connection between your application and the SchedulerX service.

ParameterDescriptionDefault
setEndpoint(String endpoint)The endpoint for your SchedulerX region.None
setNamespace(String namespace)The namespace ID for resource isolation.None
setGroupId(String groupId)The application ID (group ID) that the agent uses to connect your application. This ID is generated when you create the application.None

Authentication

Specify credentials for the SchedulerX service. Skip these if you authenticate with appKey instead.

ParameterDescriptionDefault

Networking

Override the auto-detected network settings when your environment requires it.

ParameterDescriptionDefault
setHost(String host)The IP address of your application. Set this when the auto-detected IP is incorrect, such as when using multiple network interface cards or VPNs.None (auto-detected)
setPort(int port)The port on which your application listens.None

Execution and concurrency

Two concepts apply here:

  • Grid computing: A distributed parallel computing model for batch task execution.

  • Container pool: A shared thread pool that all jobs in the application use for concurrent execution, rather than each job maintaining its own pool.

ParameterDescriptionDefault
setEnableBatchWork(boolean enableBatchWork)Enables or disables grid computing. Set to false if your application does not use grid computing. If your application uses grid computing, keep the default (true); otherwise, the first job trigger on each worker is delayed by at least 20 seconds.true
setShareContainerPool(boolean shareConatinerPool)Allows all jobs in the application to share one container pool. Set to true when many jobs run concurrently.false
setSharePoolSize(int sharePoolSize)The size of the shared container pool. Takes effect only when setShareContainerPool is true.64

Advanced tuning

Two concepts apply here:

  • Map model: A SchedulerX execution model that splits a job into subtasks and distributes them across workers (similar to the Map phase in MapReduce).

  • Second-delay job: A job triggered at second-level intervals for near-real-time scheduling.

ParameterDescriptionDefault
setMapMasterStatusCheckInterval(int interval)The interval, in milliseconds, at which SchedulerX checks whether all tasks in the Map model have completed. Reduce this value to increase the trigger frequency of second-delay jobs.3000
setEnableSecondDelayCycleIntervalMs(boolean enable)Changes the delay unit for second-delay jobs from seconds to milliseconds in the console. Set to true to increase trigger frequency.false

Lifecycle

Control application startup and shutdown behavior.

Startup

ParameterDescriptionDefault
setBlockAppStart(boolean block)Blocks the application process from starting if SchedulerX initialization fails.None

Graceful shutdown

Graceful shutdown prevents job data loss during application restarts or deployments. The shutdown mode determines which jobs must finish, and the timeout sets the maximum wait time.

ParameterDescriptionDefault
setGraceShutdownMode(String mode)The graceful shutdown strategy. Valid values: WAIT_ALL -- the application closes only after all received jobs and tasks complete. WAIT_RUNNING -- the application closes after running jobs and tasks with allocated threads complete.None (disabled)
setGraceShutdownTimeout(long delay)The maximum wait time, in seconds, for running jobs to complete before the application shuts down. If this value is not set or is 0 or less, graceful shutdown does not take effect.None

Logging and diagnostics

ParameterDescriptionDefault
setSlsCollectorEnable(boolean enable)Enables or disables log collection through Simple Log Service (SLS).true

Labels and class loading

ParameterDescriptionDefault
setLabel(String label)Assigns labels to the application at startup. Use labels to route jobs to specific workers. Typical use cases include canary releases and stress testing.None
setClassLoader(ClassLoader userClassLoader)Sets a custom class loader for non-Spring applications that use third-party frameworks.None