Springboot NexusClient and NexusServiceClient<T> support for easier, correct SANO usage
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, spring-boot
- Domain
- backend
Research direction
Start with the Spring Boot autoconfiguration and multiple-namespace support referenced in the issue, then trace how workflow clients are configured and exposed as beans. Determine how NexusClient and NexusServiceClient<T> should fit that configuration, including non-root namespaces; done means the requested client types can be injected with the described aliases and service configuration.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Guidance in javadoc for NexusClient is Client for managing standalone Nexus operation executions. Obtain an instance via newInstance(WorkflowServiceStubs) or newInstance(WorkflowServiceStubs, NexusClientOptions). Do not create this object per request; share it for the lifetime of the process.
[here])https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/NexusClient.html).
Describe the solution you'd like
First improvement
Lifestyle correctness guidance like that should be made simpler with Spring so I can nexusClient in my controller just like I can workflowClient.
We should support this across all namespaces though using the nice "non-root" namespace config support. It is Nexus, after all, so let me call across Namespaces :) .
spring.temporal:
namespaces:
# I have a couple services inside my `apps` Namespace I want to use
- namespace: apps
alias: apps
nexus-service-clients:
- alias: apps-v1
endpoint: oms-apps-v1
service: com.acme.oms.services.AppsService
- alias: support-v1
endpoint: oms-support-v1
service: com.acme.oms.services.SupportService
// my REST Controller
// Use @Qualifier since non-root referencing alias
public AppsController(@Qualifier("apps-v1NexusClient") NexusClient appsNexusClient) {
this.appsNC = appsNexusClient;
}
Customization for options (interceptors,dataconverter, etc) can follow the existing path for doing such things with workflow client...ideally we could do this in configuration directly but the requirement to code those a shortcoming that already exists in our SB integration so not necessarily part of this.
Second improvement
We can do better than this though I think and support a nexus-service-clients per client so I can do something like :
spring.temporal:
namespaces:
# I have a couple services inside my `apps` Namespace I want to use
- namespace: apps
alias: apps
nexus-service-clients:
- alias: apps-v1
endpoint: oms-apps-v1
service: com.acme.oms.services.AppsService
- alias: support-v1
endpoint: oms-support-v1
service: com.acme.oms.services.SupportService
// my REST Controller
// No @Qualifier needed but I could do it with `alias` I guess
public SupportController(NexusServiceClient<SupportService> supportSvc) {
this.supportSvc = supportSvc;
}
Describe alternatives you've considered
Roll my own @Bean but I want it to be more approachable!
Additional context
SANO is here, let's make it dead simple to integrate All The Things!
- Dominant language
- Java
- Stars
- 434
- Forks
- 260
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from temporalio/sdk-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
temporalio/sdk-java#3134 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
temporalio/sdk-java#1825 ·
Maintainers usually reply within 1 day
-
Proposal: handle SIGTERM by default to initiate graceful worker shutdownPossibly taken @eamsden claimed this 2 days ago. Open
temporalio/sdk-java#3135 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
temporalio/sdk-java#3132 · 3 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 54/100
temporalio/sdk-java#3125 · 2 comments ·
Maintainers usually reply within 1 day
All issues in temporalio/sdk-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
objectionary/eo-graphs#80 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
enhancement good first issue
Difficulty 2/5 Half a day Newbie friendliness 66/100
apache/fineract-consumer-facing#175 ·
Maintainers usually reply within 1 day
-
[BUG] 订单:会员凭订单号即可取消其他会员的待付款订单(取消接口不校验订单归属)Possibly taken @dadiyang claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
macrozheng/mall#1016 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100