temporalio / temporalio/sdk-java
Non-root namespace Spring dependencies fail on app startup
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
Expected Behavior
Defining non-root namespaces in the Spring Starter should allow beans to be injected.
Actual Behavior
The documentation calls out that this is supported, yet the BeanPostProcessor that creates these beans run after bean initialization, so application startup will fail.
In order to work around this, one must use an ObjectProvider to decouple component autowiring from Temporal bean creation, deferring bean finalization to either PostConstruct or app runtime.
Steps to Reproduce the Problem
- Create a non-root namespace configuration
- Create a
@Componentthat injects a non-rootWorkflowClient(using@Resource, per docs) - Start the application: The app should fail to start due to the non-root namespace WorkflowClient being unavailable.
Specifications
- Version: 1.29.0, 1.30.1
- Platform: N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Spring Starter's BeanPostProcessor and reproduce startup using a non-root namespace and a @Component with @Resource injection. Compare the documented behavior with the bean lifecycle involving WorkflowClient creation and ObjectProvider; done means the application starts successfully and non-root Temporal beans can be injected without deferred workarounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100