-
Notifications
You must be signed in to change notification settings - Fork 189
Plugin Support for Java SDK #2761
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
Open
donald-pinckney
wants to merge
36
commits into
master
Choose a base branch
from
d/plugins
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,024
−31
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
95e3c51
Initial version
donald-pinckney 569286a
remove discovery, update notes
donald-pinckney 9d4ba4a
remove notes
donald-pinckney 4688e95
Add initializeWorker in plugin interface.
donald-pinckney 9007d0f
Re-do shutdownWorkerFactory design with chain
donald-pinckney 6a1ae39
rename runWorkerFactory -> startWorkerFactory
donald-pinckney 057dc14
Move plugins around
donald-pinckney fb2f2e6
add startWorker and shutdownWorker
donald-pinckney 55482cb
rename again
donald-pinckney 195c241
Improved SimplePlugin builder design
donald-pinckney 26a2c0a
Remove default implementations, and add in startWorkerFactory and shu…
donald-pinckney 9a666e0
Don't return the builders
donald-pinckney 218c79b
Remove ServiceStubsSupplier and checked exception
donald-pinckney 3550c55
Cleanup applyClientPluginConfiguration
donald-pinckney 6aefa1a
array instead of list
donald-pinckney 861712e
Require ClientPlugin in WorkflowClientOptions
donald-pinckney a5a1ceb
Seaparate out WorkflowClientPlugin and WorkflowServiceStubsPlugin
donald-pinckney 0eb2ec8
Lift up to a generic ServiceStubsPlugin
donald-pinckney b4a09c5
Add ScheduleClientPlugin, and rename WorkflowClientPlugin.configureCl…
donald-pinckney b9264c6
Remove ServiceStubsPlugin super interface
donald-pinckney cf149a0
Document order of validation and plugin application
donald-pinckney 8b4b73f
abstract SimplePlugin
donald-pinckney ac094ec
Add data converters, activities, workflows, Nexus services
donald-pinckney 9760c33
bug fix
donald-pinckney 44227e8
Add duplicate warnings
donald-pinckney f1d3642
cleanup tests some
donald-pinckney 76d0482
first stab at replayer
donald-pinckney e8ed0c1
warn on duplicant *instances* not *types*
donald-pinckney 450a282
remove configure/initialize for replay
donald-pinckney 82f0934
revert WorkflowReplayer.java
donald-pinckney 4bd410a
no default
donald-pinckney c036ec1
Run plugin configures *before* setting the plugins and the defaults.
donald-pinckney fe261ba
Remove checked exceptions and simplify handling of errors
donald-pinckney 27749dd
Change types of the chains
donald-pinckney 7480385
Added overloade with public WorkflowExecutionHistory
donald-pinckney 19eab2f
simplify error handling in the case of shutdown, and document it.
donald-pinckney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
temporal-sdk/src/main/java/io/temporal/client/WorkflowClientPlugin.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
| * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved. | ||
| * | ||
| * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * Modifications copyright (C) 2017 Uber Technologies, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this material except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package io.temporal.client; | ||
|
|
||
| import io.temporal.common.Experimental; | ||
| import io.temporal.common.SimplePlugin; | ||
| import javax.annotation.Nonnull; | ||
|
|
||
| /** | ||
| * Plugin interface for customizing Temporal workflow client configuration. | ||
| * | ||
| * <p>This interface is separate from {@link | ||
| * io.temporal.serviceclient.WorkflowServiceStubs.ServiceStubsPlugin} to allow plugins that only | ||
| * need to configure the workflow client without affecting the underlying gRPC connection. | ||
| * | ||
| * <p>Plugins that implement both {@code ServiceStubsPlugin} and {@code WorkflowClientPlugin} will | ||
| * have their service stubs configuration applied when creating the service stubs, and their client | ||
| * configuration applied when creating the workflow client. | ||
| * | ||
| * <p>Plugins that also implement {@link io.temporal.worker.WorkerPlugin} are automatically | ||
| * propagated from the client to workers created from that client. | ||
| * | ||
| * <p>Example implementation: | ||
| * | ||
| * <pre>{@code | ||
| * public class LoggingPlugin extends SimplePlugin { | ||
| * public LoggingPlugin() { | ||
| * super("my-org.logging"); | ||
| * } | ||
| * | ||
| * @Override | ||
| * public void configureClient(WorkflowClientOptions.Builder builder) { | ||
| * // Add custom interceptor | ||
| * builder.setInterceptors(new LoggingInterceptor()); | ||
| * } | ||
| * } | ||
| * }</pre> | ||
| * | ||
| * @see io.temporal.serviceclient.WorkflowServiceStubs.ServiceStubsPlugin | ||
| * @see io.temporal.worker.WorkerPlugin | ||
| * @see SimplePlugin | ||
| */ | ||
| @Experimental | ||
| public interface WorkflowClientPlugin { | ||
|
|
||
| /** | ||
| * Returns a unique name for this plugin. Used for logging and duplicate detection. Recommended | ||
| * format: "organization.plugin-name" (e.g., "io.temporal.tracing") | ||
| * | ||
| * @return fully qualified plugin name | ||
| */ | ||
| @Nonnull | ||
| String getName(); | ||
|
|
||
| /** | ||
| * Allows the plugin to modify workflow client options before the client is created. Called during | ||
| * configuration phase in forward (registration) order. | ||
| * | ||
| * @param builder the options builder to modify | ||
| */ | ||
| void configureWorkflowClient(@Nonnull WorkflowClientOptions.Builder builder); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.