Skip to content

Commit d796609

Browse files
committed
refactor multi-app
Signed-off-by: salaboy <[email protected]>
1 parent 6975493 commit d796609

File tree

34 files changed

+25
-11
lines changed

34 files changed

+25
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
DaprAutoConfiguration.class, CustomerWorkflow.class, CustomerFollowupActivity.class,
4141
RegisterCustomerActivity.class, CustomerStore.class},
4242
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
43-
class ProducerAppTests {
43+
class ProducerAppIT {
4444

4545
private static final String SUBSCRIPTION_MESSAGE_PATTERN = ".*app is subscribed to the following topics.*";
4646

spring-boot-examples/workflows/remote-activities/README.md renamed to spring-boot-examples/workflows/multi-app/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Cross App (remote activities) workflow Example
1+
# Multi App workflow Example
2+
3+
This example demonstrate how you can create distributed workflows where the orchestrator doesn't host the workflow activities.
4+
5+
For more documentation about how Multi App Workflows work [check the official documentation here](https://v1-16.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-multi-app/).
26

3-
This example demonstrate how you can create distributed workflows where the orchestrator doesn't host the workflow activities.
47
This example is composed by three Spring Boot applications:
58
- `orchestrator`: The `orchestrator` app contains the Dapr Workflow definition and expose REST endpoints to create and raise events against workflow instances.
69
- `worker-one`: The `worker-one` app contains the `RegisterCustomerActivity` definition, which will be orchstrated by the `orchestrator` app.
@@ -71,7 +74,18 @@ performs the following orchestration when a new workflow instance is created:
7174
curl -X POST localhost:8080/customers/output -H 'Content-Type: application/json' -d '{ "customerName": "salaboy" }'
7275
```
7376
74-
## Testing remote activities
77+
## Testing Multi App Workflows
78+
79+
Testing becomes a complex task when you are dealing with multiple Spring Boot applications. For testing this workflow,
80+
we rely on [Testcontainers](https://testcontainers.com) to create the entire setup which enable us to run the workflow end to end.
81+
82+
You can find the end-to-end test in the [OrchestratorAppTestsIT.java]() class inside the `orchestrator` application.
83+
This test interact with the application REST endpoints to validate their correct execution.
84+
85+
But the magic behind the test can be located in the `DaprTestContainersConfig.class` which defines the configuration for
86+
all the Dapr containers and the `worker-one` and `worker-two` applications.
87+
88+
7589
7690
7791

spring-boot-examples/workflows/remote-activities/orchestrator/pom.xml renamed to spring-boot-examples/workflows/multi-app/orchestrator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<parent>
77
<groupId>io.dapr</groupId>
8-
<artifactId>remote-activities</artifactId>
8+
<artifactId>multi-app</artifactId>
99
<version>1.17.0-SNAPSHOT</version>
1010
</parent>
1111

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@SpringBootTest(classes = {TestOrchestratorApplication.class, DaprTestContainersConfig.class, CustomersRestController.class},
3030
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT,
3131
properties = {"reuse=false", "tests.workers.enabled=true"})
32-
class OrchestratorAppTestsIT {
32+
class OrchestratorAppIT {
3333

3434

3535
@BeforeEach

0 commit comments

Comments
 (0)