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 Saga pattern quickstart in Java #957

Merged
merged 12 commits into from
Jan 17, 2024
Merged

Conversation

skyao
Copy link
Member

@skyao skyao commented Nov 16, 2023

Description

This PR is to add a quickstart for saga pattern support in java.

The implementation of saga pattern is in lasted dapr-sdk-workflows v0.11.0-SNAPSHOT version which is not merged and released yet.

At this time, This PR is a preview edition:

  • Saga pattern support is still a proposal and under review and discussion.
  • This PR is to help to understand how to use saga (for solution saga-in-workflow)
  • This PR is not a final version and will keep updating during the proposal review and discussion
  • Don't merge this PR before the proposal is accepted and the design is finalized.

Issue reference

TBD: add issue here when the proposal is accepted, and the design is finalized.

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • The quickstart code compiles correctly
  • You've tested new builds of the quickstart if you changed quickstart code
  • You've updated the quickstart's README if necessary
  • If you have changed the steps for a quickstart be sure that you have updated the automated validation accordingly. All of our quickstarts have annotations that allow them to be executed automatically as code. For more information see mechanical-markdown. For user guide with examples see Examples.

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
@skyao
Copy link
Member Author

skyao commented Nov 16, 2023

how to run this quickstart

Since the proposal of saga pattern support is still under review and discussion, the code of saga pattern implementation in dapr java sdk is in preview edition as described in PR dapr/java-sdk#956.

install dapr-sdk-workflows locally

To run this quickstart, we need to build and install dapr-sdk-workflows 0.11.0-SNAPSHOT dependency locally.

# clone the PR repo before it's merged
git clone git@github.com:skyao/java-sdk.git
cd java-sdk
# checkout to the saga branch
git checkout saga-in-workflow
# install dapr-sdk-workflows 0.11.0-SNAPSHOT locally
mvn clean install

run this quickstart

# clone the PR repo before it's merged
git clone git@github.com:skyao/quickstarts.git
cd quickstarts
# checkout to the saga branch
git checkout saga-in-workflow

cd workflow-saga/java/sdk

Then reference to the README.md file in workflow-saga/java/sdk folder.

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
@skyao skyao changed the title Add Saga Java quickstart(saga-in-workflow) Add Saga pattern quickstart in Java Dec 4, 2023
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
@skyao
Copy link
Member Author

skyao commented Jan 17, 2024

@artursouza this PR can merge now.

@artursouza artursouza merged commit e30c06e into dapr:master Jan 17, 2024
7 checks passed
@skyao skyao deleted the saga-in-workflow branch January 18, 2024 08:27
@DavidEggen
Copy link

Are there any plans to make this available for C#/.net sdk?

@paulyuk
Copy link
Contributor

paulyuk commented Jan 25, 2024

Hey folks. I like this content, but it wasn't ready to be a quickstart, and I'm not sure we even want multiplier quickstarts like this (e.g. a matrix multiplier for Saga). As David's comment points out it also instantly created a "debt" to do this right for all languages, testing and so on.

@artursouza I'd ask you to revert this. @msfussell fyi. Then @skyao we should really talk about a proposal for something like this before coding the PR. Or you risk me asking you to back it out and redo it.

artursouza added a commit to artursouza/quickstarts that referenced this pull request Jan 25, 2024
artursouza added a commit to artursouza/quickstarts that referenced this pull request Jan 25, 2024
This reverts commit e30c06e.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
paulyuk added a commit that referenced this pull request Jan 25, 2024
Revert "Add Saga pattern quickstart in Java (#957)"
Go failure is ok because has nothing to do with this.
@paulyuk
Copy link
Contributor

paulyuk commented Jan 25, 2024

@skyao what do you think about taking your same content, but submitting it as an "example" under the Java sdk repo? The bar is very different for that, and we won't lose the good work here.

The very specific folder is right here: https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/workflows

@skyao skyao restored the saga-in-workflow branch March 17, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants