-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EDU-8: Update source code for "Run your first app in Java" and port t…
…o Maven (#29) * EDU-2293: Update source code for "Run your first app in Java" and port to Maven JIRA: https://temporalio.atlassian.net/browse/EDU-2293 * EDU-2293: Update source code for "Run your first app in Java" * Source code updated * Ported to Maven * Transaction details are now a single type * Jackson Deserialization is now supported for the custom type * Test run and pass * Worker runs correctly * Caller app runs correctly JIRA: https://temporalio.atlassian.net/browse/EDU-2293 * EDU-2293: Update source code for "Run your first app in Java" * Change amount from double to int * Added toggles to control the success of the deposit and refund * Add compensation mechanism to refund failed deposit JIRA: https://temporalio.atlassian.net/browse/EDU-2293 * EDU-2293: updated to rethrow exception in Workflow fail case JIRA: https://temporalio.atlassian.net/browse/EDU-2293 Updates project to use `refund` as separate method converts transactionDetails from camel to kebab 5000 retries Clean up Makefile Makefile 5000 retries
- Loading branch information
1 parent
64f673e
commit f306f3d
Showing
26 changed files
with
562 additions
and
590 deletions.
There are no files selected for viewing
This file contains 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,13 @@ | ||
.PHONY: build clean worker run | ||
|
||
build: | ||
@mvn clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=info 2>/dev/null | ||
|
||
clean: | ||
@mvn clean -q -Dmaven.logging.level=0 | ||
|
||
worker: | ||
@mvn compile exec:java -Dexec.mainClass="moneytransferapp.MoneyTransferWorker" -Dorg.slf4j.simpleLogger.defaultLogLevel=warn | ||
|
||
run: | ||
@mvn compile exec:java -Dexec.mainClass="moneytransferapp.TransferApp" -Dorg.slf4j.simpleLogger.defaultLogLevel=warn |
This file contains 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 |
---|---|---|
@@ -1,35 +1,28 @@ | ||
# Money transfer: Java project template | ||
|
||
This project can be used as a template to start building your own Temporal Workflow application. | ||
# Money transfer project: Java | ||
|
||
Learn how the pieces of a Temporal application work together. | ||
Follow the [Run your first app tutorial](https://docs.temporal.io/docs/java/run-your-first-app-tutorial) to learn more about Temporal Workflows. | ||
|
||
This project uses [Snipsync](https://github.com/temporalio/snipsync) comment wrappers to automatically keep code snippets up to date within our documentation. | ||
|
||
## How to use the template | ||
|
||
To use the template, either download it as a zip file or click "Use Template" to make a copy of it in your own Github account. | ||
Note: This project uses [Snipsync](https://github.com/temporalio/snipsync) comment wrappers to automatically keep code snippets up to date within our documentation. | ||
|
||
## Build the project | ||
## Building, cleaning, and other tasks | ||
|
||
Either open the project in IntelliJ, which will automatically build it, or in the project's root directory run: | ||
|
||
``` | ||
./gradlew build | ||
``` | ||
build: | ||
mvn clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=info 2>/dev/null | ||
## Run the Workflow | ||
clean: | ||
mvn clean -q -Dmaven.logging.level=0 | ||
First, make sure the [Temporal server](https://docs.temporal.io/docs/server/quick-install) is running. | ||
worker: | ||
mvn compile exec:java -Dexec.mainClass="moneytransferapp.MoneyTransferWorker" -Dorg.slf4j.simpleLogger.defaultLogLevel=warn | ||
To start the Workflow, either run the InitiateMoneyTransfer class from IntelliJ or from the project root run: | ||
run: | ||
mvn compile exec:java -Dexec.mainClass="moneytransferapp.TransferApp" -Dorg.slf4j.simpleLogger.defaultLogLevel=warn | ||
``` | ||
./gradlew initiateTransfer | ||
``` | ||
serve: | ||
`command -v temporal` server start-dev --log-level=never & | ||
To start the Worker, either run the MoneyTransferWorker class from IntelliJ or from the project root run: | ||
|
||
``` | ||
./gradlew startWorker --console=plain | ||
stop-server: | ||
pkill temporal | ||
``` |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.