Design the processing loop
The queue is the source of truth. Keep concurrency bounded, make handlers idempotent, and distinguish retryable failures from permanent failures.Package the worker
Use a multi-stage Dockerfile and run Node directly. The worker does not needEXPOSE or an HTTP server.
Deploy on Springwinter
1
Create a Worker resource
In your project, click Add resource and select Worker.
2
Select the code
Choose the GitHub repository and production branch. Set the start command only when the image does not already define one.
3
Set compute and configuration
Choose CPU and memory, then add queue URLs, concurrency, timeouts, and service credentials as environment variables.
4
Verify processing
Deploy a test message. Confirm one successful side effect, one acknowledgement, and useful structured logs.
Reliability rules
- Use a durable queue rather than in-memory job state.
- Include an idempotency key in each message.
- Acknowledge only after the durable side effect succeeds.
- Configure dead-letter handling for repeatedly failing jobs.
- Keep concurrency below downstream database and API limits.
- Emit job duration, success, retry, and failure counters.
- Test container replacement while jobs are running.
Scaling and cost
Increase task size when each job needs more CPU or memory. Increase worker replicas when jobs are independent and queue depth rises. Current Springwinter workers are continuously running services, so they are not a scale-to-zero substitute for one-off ECS tasks or AWS Batch.Frequently asked questions
Should a Node.js worker expose a health endpoint?
Should a Node.js worker expose a health endpoint?
A Springwinter Worker does not expose a public HTTP port. Use process liveness, queue metrics, job completion metrics, and logs to determine whether it is making progress.
Can one worker process several jobs concurrently?
Can one worker process several jobs concurrently?
Yes, but bound concurrency explicitly. Unlimited promises can exhaust memory, database connections, queue visibility windows, or third-party rate limits.
How should deployments handle in-flight jobs?
How should deployments handle in-flight jobs?
Stop polling after
SIGTERM, finish work within the drain window, then exit. Jobs that cannot finish safely must become visible again and be idempotent when retried.