-
Notifications
You must be signed in to change notification settings - Fork 223
Feat Cross App CallActivity #1468
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
8f453d6
cross app ex
cicoyle 455467c
update protoc cmd
cicoyle 869cb83
feedback
cicoyle 613dfb0
builder pattern
cicoyle c927075
fix protoc
cicoyle 466e799
debug log levels for test containers
cicoyle 7411384
update readme and add debugging info
cicoyle 2876fee
add IT test for cross app call activity
cicoyle 4836553
cleanup test
cicoyle 8a8b36e
sysout -> ctx.logger
cicoyle af2e57d
reset pom
cicoyle fcaf699
rm debug lines from readme
cicoyle b5f541b
fix header + rm customports
cicoyle 710ba9d
use consts
cicoyle 0d5c425
rm waitfor call
cicoyle b0e5e23
rm pubsub
cicoyle 015d200
rm timeout
cicoyle 46f6c3b
reset empty lines added
cicoyle a45cb00
reset appname for daprcontainer
cicoyle 14c9185
reset empty line diff
cicoyle 6f42fed
rm constructor info from readme
cicoyle 5dd363d
debug -> info
cicoyle 3613cd3
rm super.start
cicoyle 1aaefa6
reset dapr container diff
cicoyle 4e9fab4
add test for codecov
cicoyle c1aadc1
up timeout time to unblock PR
cicoyle 973ed3c
deps: Update durabletask-client to 1.5.10
javier-aliaga a5ecd04
ci: Revert build timeout
javier-aliaga ed8214d
review: Use ctx.getLogger
javier-aliaga b756cde
chore: Fix review comments
javier-aliaga efa979c
chore: more review comments fixes
javier-aliaga 101904d
test: Use testcontainers in CrossApp IT test
javier-aliaga 13921bf
chore: Load classpath for IT with all dependencies
javier-aliaga 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
34 changes: 34 additions & 0 deletions
34
examples/src/main/java/io/dapr/examples/workflows/crossapp/App2TransformActivity.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,34 @@ | ||
| /* | ||
| * Copyright 2025 The Dapr Authors | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file 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.dapr.examples.workflows.crossapp; | ||
|
|
||
| import io.dapr.workflows.WorkflowActivity; | ||
| import io.dapr.workflows.WorkflowActivityContext; | ||
|
|
||
| /** | ||
| * TransformActivity for App2 - transforms input to uppercase. | ||
| * This activity is called cross-app from the main workflow. | ||
| */ | ||
| public class App2TransformActivity implements WorkflowActivity { | ||
| @Override | ||
| public Object run(WorkflowActivityContext context) { | ||
| String input = context.getInput(String.class); | ||
| var logger = context.getLogger(); | ||
| logger.info("=== App2: TransformActivity called ==="); | ||
| logger.info("Input: {}", input); | ||
| String result = input.toUpperCase() + " [TRANSFORMED BY APP2]"; | ||
| logger.info("Output: {}", result); | ||
| return result; | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
examples/src/main/java/io/dapr/examples/workflows/crossapp/App2Worker.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,37 @@ | ||
| /* | ||
| * Copyright 2025 The Dapr Authors | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file 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.dapr.examples.workflows.crossapp; | ||
|
|
||
| import io.dapr.workflows.runtime.WorkflowRuntime; | ||
| import io.dapr.workflows.runtime.WorkflowRuntimeBuilder; | ||
|
|
||
| /** | ||
| * App2 Worker - registers only the TransformActivity. | ||
| * This app will handle cross-app activity calls from the main workflow. | ||
| */ | ||
| public class App2Worker { | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| System.out.println("=== Starting App2Worker ==="); | ||
| // Register the Workflow with the builder | ||
| WorkflowRuntimeBuilder builder = new WorkflowRuntimeBuilder() | ||
| .registerActivity(App2TransformActivity.class); | ||
|
|
||
| // Build and start the workflow runtime | ||
| try (WorkflowRuntime runtime = builder.build()) { | ||
| System.out.println("App2 is ready to receive cross-app activity calls..."); | ||
| runtime.start(); | ||
| } | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
examples/src/main/java/io/dapr/examples/workflows/crossapp/App3FinalizeActivity.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,34 @@ | ||
| /* | ||
| * Copyright 2025 The Dapr Authors | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file 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.dapr.examples.workflows.crossapp; | ||
|
|
||
| import io.dapr.workflows.WorkflowActivity; | ||
| import io.dapr.workflows.WorkflowActivityContext; | ||
|
|
||
| /** | ||
| * FinalizeActivity for App3 - adds final processing. | ||
| * This activity is called cross-app from the main workflow. | ||
| */ | ||
| public class App3FinalizeActivity implements WorkflowActivity { | ||
| @Override | ||
| public Object run(WorkflowActivityContext context) { | ||
javier-aliaga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| String input = context.getInput(String.class); | ||
| var logger = context.getLogger(); | ||
| logger.info("=== App3: FinalizeActivity called ==="); | ||
| logger.info("Input: {}", input); | ||
| String result = input + " [FINALIZED BY APP3]"; | ||
| logger.info("Output: {}", result); | ||
| return result; | ||
| } | ||
| } | ||
37 changes: 37 additions & 0 deletions
37
examples/src/main/java/io/dapr/examples/workflows/crossapp/App3Worker.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,37 @@ | ||
| /* | ||
| * Copyright 2025 The Dapr Authors | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file 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.dapr.examples.workflows.crossapp; | ||
|
|
||
| import io.dapr.workflows.runtime.WorkflowRuntime; | ||
| import io.dapr.workflows.runtime.WorkflowRuntimeBuilder; | ||
|
|
||
| /** | ||
| * App3 Worker - registers only the FinalizeActivity. | ||
| * This app will handle cross-app activity calls from the main workflow. | ||
| */ | ||
| public class App3Worker { | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| System.out.println("=== Starting App3Worker ==="); | ||
| // Register the Workflow with the builder | ||
| WorkflowRuntimeBuilder builder = new WorkflowRuntimeBuilder() | ||
| .registerActivity(App3FinalizeActivity.class); | ||
|
|
||
| // Build and start the workflow runtime | ||
| try (WorkflowRuntime runtime = builder.build()) { | ||
| System.out.println("App3 is ready to receive cross-app activity calls..."); | ||
| runtime.start(); | ||
| } | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
examples/src/main/java/io/dapr/examples/workflows/crossapp/CrossAppWorker.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,32 @@ | ||
| /* | ||
| * Copyright 2025 The Dapr Authors | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file 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.dapr.examples.workflows.crossapp; | ||
|
|
||
| import io.dapr.workflows.runtime.WorkflowRuntime; | ||
| import io.dapr.workflows.runtime.WorkflowRuntimeBuilder; | ||
|
|
||
| public class CrossAppWorker { | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| // Register the Workflow with the builder | ||
| WorkflowRuntimeBuilder builder = new WorkflowRuntimeBuilder() | ||
| .registerWorkflow(CrossAppWorkflow.class); | ||
|
|
||
| // Build and start the workflow runtime | ||
| try (WorkflowRuntime runtime = builder.build()) { | ||
| System.out.println("CrossAppWorker started - registered CrossAppWorkflow only"); | ||
| runtime.start(); | ||
| } | ||
| } | ||
| } |
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.