Merge pull request #20 from andrewshan/main

optimize quickstart document
pull/25/head
andrew shan 3 years ago committed by GitHub
commit 2fe50390ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,9 @@
# Spring Cloud Polaris Quickstart example
[English](./README.md) | 简体中文
---
## 样例简介
本样例将介绍如何使应用快速接入Spring Cloud Tencent。
@ -8,7 +12,8 @@
### 修改配置
在 polaris-quickstart-example/quickstart-provider 以及 polaris-quickstart-example/quickstart-consumer 两个项目中修改bootstrap.yml修改后配置如下所示。其中${ip}和${port}为Polaris后端服务的IP地址与端口号。
在 ```polaris-quickstart-example/quickstart-provider``` 以及 ```polaris-quickstart-example/quickstart-consumer``` 两个项目中,修改```bootstrap.yml```,修改后配置如下所示。
其中,```${ip}```和${port}为Polaris后端服务的IP地址与端口号。
```yaml
spring:
@ -25,7 +30,7 @@ spring:
- IDEA启动
找到 polaris-quickstart-example/quickstart-provider 项目的主类 EchoServerApplication执行 main 方法启动样例。
找到 ```polaris-quickstart-example/quickstart-provider``` 项目的主类 ```EchoServerApplication```,执行 main 方法启动样例。
- Maven打包启动
@ -47,7 +52,7 @@ java -jar ${app.jar}
- IDEA启动
找到 polaris-quickstart-example/quickstart-consumer 项目的主类 EchoClientApplication执行 main 方法启动样例。
找到 ```polaris-quickstart-example/quickstart-consumer``` 项目的主类 ```EchoClientApplication```,执行 main 方法启动样例。
- Maven打包启动

@ -1,6 +1,10 @@
# Spring Cloud Polaris Quickstart example
## Example Introduction
English | [简体中文](./README-zh.md)
---
## Introduction
This example shows how to make application integrated with spring-cloud-tencent rapidly.
@ -8,7 +12,7 @@ This example shows how to make application integrated with spring-cloud-tencent
### Configuration
Modify bootstrap.yml, ${ip} and ${port} is the address of polaris server.
Modify ```bootstrap.yml```, ${ip} and ${port} is the address of polaris server.
```yaml
spring:
@ -19,17 +23,39 @@ spring:
address: grpc://${ip}:${port}
```
### Launching Example
### Start Application
#### Start Provider
- Start in IDEA
Find main class ```EchoServerApplication``` in project ```polaris-quickstart-example/quickstart-provider```, and execute the main method.
- Start by fatjar
Run build command in ```polaris-quickstart-example/quickstart-provider```:
```sh
mvn clean package
```
find the generated fatjar, run:
```
java -jar ${app.jar}
```
${app.jar} replace to the built jar name.
#### Launching Application
#### Start Consumer
- Start in IDEA
Find main class EchoServiceApplication in project polaris-quickstart-example, and execute the main method.
Find main class ```EchoClientApplication``` in project ```polaris-quickstart-example/quickstart-consumer```, and execute the main method.
- Start by fatjar
Run build command in ```spring-cloud-tencent-examples/polaris-quickstart-example```:
Run build command in ```polaris-quickstart-example/quickstart-consumer```:
```sh
mvn clean package
@ -47,8 +73,13 @@ ${app.jar} replace to the built jar name.
#### Invoke by http call
Consumer and Provider application use random generated port, so you need to record the consumer port from start log.
```
11:26:53 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 58838 (http) with context path ''
```
Invoke http callreplace `${app.port}` to the consumer port.
```shell
curl -L -X GET 'http://localhost:47080/quickstart/feign?msg=hello_world''
```
expecthello_world
expect`echo: hello_world`
Loading…
Cancel
Save