Skip to content

Support Spring property placeholders in @WorkflowImpl workers attribute - #2994

Open
sachinsharma3191 wants to merge 3 commits into
temporalio:mainfrom
sachinsharma3191:fix/2747-spring-worker-name-placeholders
Open

Support Spring property placeholders in @WorkflowImpl workers attribute#2994
sachinsharma3191 wants to merge 3 commits into
temporalio:mainfrom
sachinsharma3191:fix/2747-spring-worker-name-placeholders

Conversation

@sachinsharma3191

@sachinsharma3191 sachinsharma3191 commented Aug 10, 2026

Copy link
Copy Markdown

What was changed

Added environment.resolvePlaceholders(workerName) in three methods in WorkersTemplate.java:

  • configureWorkflowImplementationsByWorkerName
  • configureActivityBeansByWorkerName
  • configureNexusServiceBeansByWorkerName

Why?

Issue #2747: the workers attribute in @WorkflowImpl, @ActivityImpl, and @NexusServiceImpl did not resolve Spring property placeholders like ${my.worker.name}. The taskQueues attribute already resolves placeholders, so this makes workers consistent.

Checklist

  • Added resolvePlaceholders call in all three methods
  • Consistent with existing taskQueues placeholder resolution pattern

Fixes #2747

@dplyukhin

Copy link
Copy Markdown
Contributor

Thanks for the contrib. Is this PR still in progress? The checklist isn't checked off. If in progress, please convert to a draft PR. Please also update the PR description to use the template we provide. Please also take note of the contributing guidelines - particularly AI-generated PRs. Please make sure to review AI contributions thoroughly yourself before opening a PR.

@sachinsharma3191

Copy link
Copy Markdown
Author

Thanks for the review! I've updated the PR description to use the repo's template format and checked off the checklist.

This addresses issue #2747 — adds resolvePlaceholders for the workers attribute, making it consistent with the existing taskQueues resolution. I've reviewed the change thoroughly.

@Quinn-With-Two-Ns

Copy link
Copy Markdown
Contributor

If this PR add some new feature or capability please also add test verifying any new feature or behaviour

@dplyukhin dplyukhin self-assigned this Aug 13, 2026
@sachinsharma3191

Copy link
Copy Markdown
Author

@Quinn-With-Two-Ns Added a test in cf8b6bc8:

  • New test class AutoDiscoveryByWorkerNameResolverTest verifies that @WorkflowImpl(workers = "${worker.name}") and @ActivityImpl(workers = "${worker.name}") correctly resolve Spring property placeholders at registration time.
  • Follows the same pattern as AutoDiscoveryByTaskQueueResolverTest which tests the equivalent taskQueues resolution.
  • Test passes locally.

@dplyukhin Could you review this PR along with #2992 and #2993 when you get a chance? All three are ready for review. Thanks!

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


sachinsharma seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

sachinsharma added 3 commits August 31, 2026 08:32
taskQueues already resolves placeholders via environment.resolvePlaceholders(),
but workers did not. Add the same resolution to configureWorkflowImplementationsByWorkerName,
configureActivityBeansByWorkerName, and configureNexusServiceBeansByWorkerName.

Fixes temporalio#2747
Verifies that @WorkflowImpl(workers = "${worker.name}") and
@ActivityImpl(workers = "${worker.name}") correctly resolve Spring
property placeholders at registration time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@WorkflowImpl(workers = "...") should support Spring property placeholders like taskQueues does

4 participants