-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,038 additions
and
5 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
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,2 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
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,22 @@ | ||
# This is the demo Dockerfile for the generated template project, please change accordingly before building image from it. | ||
# Run the following command to build image: docker build -f ./Dockerfile --build-arg APP_FILE=demo-0.0.1-SNAPSHOT.jar -t demo:latest . | ||
FROM openjdk:17-jdk-alpine | ||
|
||
# Set the working directory to /build | ||
WORKDIR /build | ||
COPY . /build | ||
|
||
RUN chmod +x ./mvnw | ||
RUN ./mvnw clean package -U | ||
|
||
# JAR file will be specified by passing in a build time argument to docker build | ||
ARG APP_FILE | ||
|
||
# Remember to change the port according to the RPC protocol you select | ||
EXPOSE 50051 | ||
|
||
# copy the JAR file into the root and rename | ||
RUN cp ./target/${APP_FILE} app.jar | ||
|
||
# Run java with the jar file when the container starts up | ||
CMD ["java","-jar","app.jar"] |
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,12 @@ | ||
# Getting Started | ||
|
||
### Reference Documentation | ||
For further reference, please consider the following sections: | ||
|
||
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) | ||
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.2/maven-plugin/reference/html/) | ||
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.2/maven-plugin/reference/html/#build-image) | ||
* [Dubbo Zookeeper registry configuration reference](https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/registry/zookeeper/) | ||
* [Dubbo triple protocol reference](https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/protocol/triple/) | ||
* [Dubbo Zookeeper registry configuration reference](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsingle/#web.servlet.spring-mvc.template-engines) | ||
|
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,55 @@ | ||
# Getting Started | ||
This project is generated by [start.dubbo.apache.org](https://start.dubbo.apache.org/) and used as the demonstration code of the quick-start on our official website [dubbo.apache.org](https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/quick-start/microservice/starter/). | ||
|
||
Check more samples from other directories like [1-basic](../../1-basic), [2-advanced](../../2-advanced), etc. | ||
|
||
## How to run | ||
|
||
### Install dependencies | ||
Step into '11-quickstart' directory, run the following command: | ||
|
||
```shell | ||
$ mvn clean install | ||
``` | ||
|
||
This will install all the modules especially `quickstart-api` in the local maven repo. | ||
|
||
### Run quick start demo | ||
Enter `quickstart-service` directory: | ||
```shell | ||
$ cd 11-quickstart/quickstart-service | ||
``` | ||
|
||
then, run the following command to start Dubbo process: | ||
```shell | ||
$ mvn compile exec:java -Dexec.mainClass="org.apache.dubbo.samples.quickstart.QuickStartApplication" | ||
``` | ||
|
||
Run the following command to see server works as expected: | ||
```shell | ||
$ curl \ | ||
--header "Content-Type: application/json" \ | ||
--data '["Dubbo"]' \ | ||
http://localhost:50051/org.apache.dubbo.samples.quickstart.dubbo.api.DemoService/sayHello/ | ||
``` | ||
|
||
## Publish service definition | ||
Publish the Dubbo service definition(java interface) in `quickstart-api` to maven repository so that consumers that need to call this service can import the definition by importing `quickstart-api` maven dependency in their pom.xml. | ||
|
||
Enter directory `quickstart-api` | ||
```shell | ||
$ cd 11-quickstart/quickstart-api | ||
$ mvn clean deploy | ||
``` | ||
|
||
## Reference Documentation | ||
For further reference, please consider the following sections: | ||
|
||
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) | ||
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.2/maven-plugin/reference/html/) | ||
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.2/maven-plugin/reference/html/#build-image) | ||
* [Dubbo Zookeeper registry configuration reference](https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/registry/zookeeper/) | ||
* [Dubbo triple protocol reference](https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/protocol/triple/) | ||
* [Dubbo Zookeeper registry configuration reference](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsingle/#web.servlet.spring-mvc.template-engines) | ||
|
||
|
Oops, something went wrong.