-
Notifications
You must be signed in to change notification settings - Fork 0
fix(c7-embedded, c7-remote): tasks not delivered when workerLockDurationInMilliseconds restriction is set #167
Description
When the adapter polls for external service tasks, it matches each locked task against registered subscriptions. This matching checks task properties like topic name, but also evaluates all restrictions defined on the subscription. With process-engine-worker 0.8.0 we introduced the workerLockDurationInMilliseconds restriction to allow configuring a custom lock timeout per subscription — but we did not add a corresponding case to the matches() method in either adapter variant. As a result, any subscription that uses this restriction hits the else -> false branch and is never matched, so its tasks are never delivered.
Steps to reproduce
- Library version: current main, process-engine-worker >= 0.8.0
- JDK version: 17+
- Operating system: any
- Steps:
- Register a subscription with
workerLockDurationInMillisecondsset in its restrictions. - The engine returns a locked task matching that subscription's topic.
- The task is never delivered —
matches()returnsfalsedue to the unhandled restriction key.
- Register a subscription with
Expected behaviour
workerLockDurationInMilliseconds is a worker-side configuration hint and should not affect task matching. A subscription with this restriction set should be matched and receive tasks normally. Additionally, the else branch should log the unrecognised restriction key at debug level so unmatched restrictions are visible during troubleshooting.
Actual behaviour
c7-embedded-core — EmbeddedPullServiceTaskDelivery.matches():
CommonRestrictions.PROCESS_DEFINITION_VERSION_TAG -> it.value == task.processDefinitionVersionTag
else -> false // workerLockDurationInMilliseconds hits this branch — no log, no matchc7-remote-core — PullServiceTaskDelivery.matches():
CommonRestrictions.PROCESS_DEFINITION_VERSION_TAG -> it.value == task.processDefinitionVersionTag
else -> false // workerLockDurationInMilliseconds hits this branch — no log, no matchNote: both variants already handle workerLockDurationInMilliseconds correctly in their getLockDurationForSubscription() helper — the fix is only needed in matches().