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 new seata samples #1041

Merged
merged 36 commits into from
Mar 6, 2024
Merged

Add new seata samples #1041

merged 36 commits into from
Mar 6, 2024

Conversation

xingfudeshi
Copy link
Member

Hello Dubbo dev team, I am PPMC from Apache Seata. I have submitted a new Seata example that uses minimal third-party dependencies and can help beginners quickly understand how Seata and Dubbo work together.
Also, later this week, I will submit the PR of the usage documentation for seata to dubbo websites

@wxbty
Copy link
Member

wxbty commented Jan 29, 2024

Thanks for your pr ,@xingfudeshi, I don't quite understand why the demo needs to be completely replaced. The existing one looks simple enough, can you list some?

@xingfudeshi
Copy link
Member Author

xingfudeshi commented Jan 31, 2024

Hi, @wxbty
The seata community received an email from the dubbo community, hoping that we can help update the samples and documents for the upcoming Apache Dubbo 3.3.0. So, I checked the documents and examples of seata that already exist in the dubbo community, and I found some problems. :

  1. The document is a bit complicated and contains some repeated information, which is more theoretical.
  2. For Dubbo users, they may not be familiar with Seata, so it is necessary that we simplify cases and tutorials to help them quickly experience how Seata and Dubbo work together.

Therefore, I re-wrote a document, and the PR has been submitted here [2], and this sample is matched with that document. This time the document does not rely on any third-party components, and only requires dubbo and seata to complete, I believe It will definitely give users a good experience.

[1]https://lists.apache.org/thread/6853sjp0qxt2rv975fbkhvf4rpo1fsnv
[2]apache/dubbo-website#2906
doc preview:https://deploy-preview-2905--dubbo.netlify.app/zh-cn/overview/mannual/java-sdk/tasks/trasaction/distributed-transaction/

@wxbty
Copy link
Member

wxbty commented Jan 31, 2024

Okay, I've got the background, I will check it later. In addition, if you use dubbo-sample examples, it is recommended that the document add one-click test examples: ./test/run-tests.sh 2-advanced/dubbo-samples-seata. It will start the relevant components and services, start it once, and finally execute the test case

@AlbumenJ
Copy link
Member

@slievrly @chickenlj PTAL

@xingfudeshi
Copy link
Member Author

Okay, I've got the background, I will check it later. In addition, if you use dubbo-sample examples, it is recommended that the document add one-click test examples: ./test/run-tests.sh 2-advanced/dubbo-samples-seata. It will start the relevant components and services, start it once, and finally execute the test case

Ok.I'll do that.

@wxbty
Copy link
Member

wxbty commented Feb 1, 2024

@xingfudeshi Please refer to the original example to restore the two files case-configuration.yml and case-versions.conf. The example of dubbo-sample not only allows users to manually execute unit tests, but also is the source of automatic integration testing for dubbo main repository workflow. Automatic testing requires One-click testing, this is the role of case-configuration.yml. And case-versions.conf can help us test the dependencies of the specified version matrix

# Conflicts:
#	2-advanced/dubbo-samples-seata/case-configuration.yml
#	2-advanced/dubbo-samples-seata/case-versions.conf
#	2-advanced/dubbo-samples-seata/deploy/All.yml
#	2-advanced/dubbo-samples-seata/deploy/Namespace.yml
#	2-advanced/dubbo-samples-seata/deploy/account/Deployment.yml
#	2-advanced/dubbo-samples-seata/deploy/business/Deployment.yml
#	2-advanced/dubbo-samples-seata/deploy/docker-compose/mysql/sql/undo-log.sql
#	2-advanced/dubbo-samples-seata/deploy/order/Deployment.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-mysql/ConfigMap.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-mysql/Deployment.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-mysql/PersistentVolume.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-mysql/PersistentVolumeClaim.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-mysql/Service.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-server/Deployment.yml
#	2-advanced/dubbo-samples-seata/deploy/seata-server/Service.yml
#	2-advanced/dubbo-samples-seata/deploy/stock/Deployment.yml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-account/pom.xml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-account/src/main/resources/application.yml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-business/pom.xml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-business/src/main/java/org/apache/dubbo/samples/seata/business/service/BusinessServiceImpl.java
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-order/pom.xml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-order/src/main/resources/application.yml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-stock/pom.xml
#	2-advanced/dubbo-samples-seata/dubbo-samples-seata-stock/src/main/resources/application.yml
#	2-advanced/dubbo-samples-seata/pom.xml
@xingfudeshi
Copy link
Member Author

@xingfudeshi Please refer to the original example to restore the two files case-configuration.yml and case-versions.conf. The example of dubbo-sample not only allows users to manually execute unit tests, but also is the source of automatic integration testing for dubbo main repository workflow. Automatic testing requires One-click testing, this is the role of case-configuration.yml. And case-versions.conf can help us test the dependencies of the specified version matrix

Done.

@wxbty
Copy link
Member

wxbty commented Feb 24, 2024

[root@VM-16-12-centos dubbo-samples]# ./test/run-tests.sh 2-advanced/dubbo-samples-seata/
image

@xingfudeshi xingfudeshi reopened this Feb 28, 2024
@wxbty
Copy link
Member

wxbty commented Feb 28, 2024

What about changing to java8 version? Java17 seems to have a problem with the old seata-sample, and the test is ignored during execution.

@xingfudeshi
Copy link
Member Author

What about changing to java8 version? Java17 seems to have a problem with the old seata-sample, and the test is ignored during execution.

Ok.I'll take a look on it.

@xingfudeshi xingfudeshi reopened this Feb 29, 2024
@xingfudeshi
Copy link
Member Author

I have been trying for a long time but still cannot succeed. Please help me check where the problem is
It seems to be a network issue in the Docker environment. I'm not sure if it's because I'm using Multicast. Please take a look at my code.

dubbo:
    application:
        logger: slf4j
        name: ${spring.application.name}
        qos-enable: false
    registry:
        address: multicast://224.5.6.7:1234
    protocol:
        port: 20881
        name: dubbo

I don't want to introduce any extra middleware to increase the time cost of user experience data, so I use Multicast as the registry.

@xingfudeshi
Copy link
Member Author

image image image image image

@xingfudeshi
Copy link
Member Author

I can run these samples through a regular spring boot application without any problem

@xingfudeshi
Copy link
Member Author

I've figured it out, the previous issue was due to some mistakes.Now the test has passed.
image

@wxbty
Copy link
Member

wxbty commented Feb 29, 2024

On my server, it also passed the test and there seems to be no problem. @AlbumenJ PTAL again

Copy link
Member

@wxbty wxbty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlbumenJ AlbumenJ merged commit 1f8c4ef into apache:master Mar 6, 2024
55 checks passed
Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

3 participants