Skip to content

Add Spring Boot auto-configuration for ActivityClient - #3157

Open
Quinn-With-Two-Ns wants to merge 3 commits into
mainfrom
spring-activity-client-3146
Open

Quinn-With-Two-Ns wants to merge 3 commits into
mainfrom
spring-activity-client-3146

Conversation

@Quinn-With-Two-Ns

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

  • Auto-configure a primary temporalActivityClient and namespace/alias-prefixed activity clients, following the existing ScheduleClient wiring and capabilities.
  • Apply namespace data converters, root ActivityClientInterceptor beans, and ordered TemporalOptionsCustomizer<ActivityClientOptions.Builder> beans, including the existing namespace-specific naming convention.
  • Add wiring and options customization tests, documentation, and a changelog entry.

Why?

Applications should be able to inject an ActivityClient without manually reproducing the Spring namespace, converter, and interceptor configuration. Invocation-specific task queues and timeouts remain in StartActivityOptions.

Fixes #3146.


Note

Medium Risk
Expands Spring bean surface and constructor signatures in autoconfigure templates; misconfigured customizers or duplicate beans could affect runtime client behavior, but changes mirror existing ScheduleClient patterns.

Overview
Spring Boot now wires ActivityClient the same way it already does for ScheduleClient: a primary temporalActivityClient for the root namespace and <alias-or-namespace>ActivityClient beans for each configured non-root namespace.

ClientTemplate lazily builds clients from shared service stubs (including the test-server path). WorkflowClientOptionsTemplate.createActivityClientOptions() sets namespace and data converter, prepends OpenTracing when a Tracer is present, applies root ActivityClientInterceptor beans only on the root client, and runs ordered TemporalOptionsCustomizer<ActivityClientOptions.Builder> beans (namespace-specific names like assignActivityClientCustomizer for non-root). Non-root namespaces register their activity client via NonRootBeanPostProcessor.

Deprecated overloads on ClientTemplate, NonRootNamespaceTemplate, and WorkflowClientOptionsTemplate that omitted activity-client parameters were removed. README, changelog, and tests cover injection, customizers, multi-namespace beans, and interceptor ordering.

Reviewed by Cursor Bugbot for commit 04f208e. Bugbot is set up for automated code reviews on this repo. Configure here.

@Quinn-With-Two-Ns
Quinn-With-Two-Ns marked this pull request as ready for review October 20, 2026 17:34
@Quinn-With-Two-Ns
Quinn-With-Two-Ns requested a review from a team as a code owner October 20, 2026 17:35
@panakantinandu

Copy link
Copy Markdown

Hi Quinn, thanks for working on the ActivityClient Spring Boot integration!

While reviewing #3157, I noticed that createActivityClientOptions() doesn't register OpenTracingActivityClientInterceptor when a Tracer bean is available, whereas the existing workflow client configuration handles tracing.

I reproduced this locally on the PR branch by adding a regression test. Both test-server and non-test-server configurations failed because the activity client was missing the tracing interceptor.

I then tested a small fix that registers OpenTracingActivityClientInterceptor before user-provided interceptors, following the workflow client pattern.

The targeted tests now pass:

  • ActivityClientAutoConfigurationTest: 6/6
  • ClientOnlyTest: 3/3
  • MultiNamespaceTest: 1/1
  • AutoConfigOrderingTest: 1 passed, 1 skipped

The regression test verifies interceptor registration and ordering across root and non-root namespaces. I haven't verified actual span generation end to end.

Would you be open to a small follow-up contribution with the fix and regression tests, or would you prefer to incorporate it into your existing PR?

Happy to help either way!

This branch has not been deployed

No deployments
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.

Add Spring Boot auto-configuration for standalone ActivityClient

2 participants