File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,24 @@ Set a default resolver in config for all jobs:
390390},
391391```
392392
393+ ### Partition Resolution Priority
394+
395+ When determining the partition key, the following order is used:
396+
397+ | Priority | Method | Description |
398+ | ----------| --------| -------------|
399+ | 1 | ` onPartition() ` | Explicitly set when dispatching |
400+ | 2 | ` getPartitionKey() ` | Custom method defined in your job class |
401+ | 3 | ` partition_resolver ` | Global resolver from config |
402+ | 4 | Auto-detection | Properties: ` userId ` , ` user_id ` , ` tenantId ` , ` tenant_id ` |
403+ | 5 | ` 'default' ` | Fallback partition |
404+
405+ The first non-null value wins. This allows you to:
406+ - Override everything with ` onPartition() ` at dispatch time
407+ - Define custom logic per job with ` getPartitionKey() `
408+ - Set a global default with ` partition_resolver ` in config
409+ - Rely on automatic detection for simple cases
410+
393411---
394412
395413## Advanced Usage
You can’t perform that action at this time.
0 commit comments