Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LocalActivityOption#contextPropagators #490

Closed
Spikhalskiy opened this issue May 14, 2021 · 1 comment
Closed

Add LocalActivityOption#contextPropagators #490

Spikhalskiy opened this issue May 14, 2021 · 1 comment
Labels
enhancement User experience

Comments

@Spikhalskiy
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Looks like Temporal Java SDK is lacking the support of context propagators for local activities.
Currently, there is no way to make context propagation work for LocalActivities as described in Issue #489.
But even when #489 is resolved, Java SDK API lacks functionality for LocalActivities + ContextPropagators comparable to the one that is available for Activities + ContextPropagators.
ActivityOption has ActivityOption#contextPropagators that allow specifying custom context propagators for the activity.
You would expect that LocalActivityOption will have LocalActivityOption#contextPropagators with the same semantic, but it's not there.

Describe the solution you'd like
Add LocalActivityOption#contextPropators and ensure they are supported the same way as ActivityOption#contextPropators

@Spikhalskiy
Copy link
Contributor Author

Spikhalskiy commented May 19, 2021

After discussion with @mfateev we decided that ActivityOptions#contextPropagators has extremely limited usage.
Probably the only reasonable use case would be if we have a regular activity implemented in a different codebase or language.
Otherwise, ContextPropagators should be specified on WorkerOptions and be applied for all activities on both the caller (workflow) and activity worker side anyway, because ActivityOptions are used and applied only on a caller side. Adding a ContextPropagator just to the ActivityOptions doesn’t enable it on the Acitivity Worker side.
So, it's not a good idea to adapt it for local activities, and event the existing ActivityOptions#contextPropagators should be used carefully with full understanding that they are applied only to the client/stub side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User experience
Projects
None yet
Development

No branches or pull requests

1 participant