Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
ba8f4821
Commit
ba8f4821
authored
Jun 28, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改介绍
parent
6013db2e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
README.md
+8
-10
No files found.
README.md
View file @
ba8f4821
...
@@ -143,7 +143,7 @@ public class DiscoveryConfigAdapter extends ConfigAdapter {
...
@@ -143,7 +143,7 @@ public class DiscoveryConfigAdapter extends ConfigAdapter {
### 单独推送规则信息
### 单独推送规则信息
使用者可以通过Rest方式主动向一个微服务推送规则信息,但该方式只能每次推送到一个微服务上(注意:端口号为management.port的值)
使用者可以通过Rest方式主动向一个微服务推送规则信息,但该方式只能每次推送到一个微服务上(注意:端口号为management.port的值)
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"config"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
path
=
"config"
,
method
=
RequestMethod
.
POST
)
public
Object
config
(
@RequestBody
String
config
)
public
Object
config
(
@RequestBody
String
config
)
...
@@ -154,7 +154,7 @@ http://IP:[management.port]/admin/config
...
@@ -154,7 +154,7 @@ http://IP:[management.port]/admin/config
### 查看当前生效的规则信息
### 查看当前生效的规则信息
使用者可以通过Rest方式主动请求某个微服务当前生效的规则(注意:端口号为management.port的值)
使用者可以通过Rest方式主动请求某个微服务当前生效的规则(注意:端口号为management.port的值)
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"view"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"view"
,
method
=
RequestMethod
.
GET
)
public
String
view
()
public
String
view
()
...
@@ -165,7 +165,7 @@ http://IP:[management.port]/admin/view
...
@@ -165,7 +165,7 @@ http://IP:[management.port]/admin/view
## 路由中心
## 路由中心
### 获取本地节点可访问其他节点(根据服务名)的实例列表
### 获取本地节点可访问其他节点(根据服务名)的实例列表
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"/instances/{serviceId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/instances/{serviceId}"
,
method
=
RequestMethod
.
GET
)
public
List
<
ServiceInstance
>
instances
(
@PathVariable
(
value
=
"serviceId"
)
String
serviceId
)
public
List
<
ServiceInstance
>
instances
(
@PathVariable
(
value
=
"serviceId"
)
String
serviceId
)
...
@@ -175,7 +175,7 @@ http://IP:[server.port]/instances/{serviceId}
...
@@ -175,7 +175,7 @@ http://IP:[server.port]/instances/{serviceId}
### 获取本地节点的路由信息(只显示当前节点的简单信息,不包含下级路由)
### 获取本地节点的路由信息(只显示当前节点的简单信息,不包含下级路由)
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"/info"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/info"
,
method
=
RequestMethod
.
GET
)
public
RouterEntity
info
()
public
RouterEntity
info
()
...
@@ -185,7 +185,7 @@ http://IP:[server.port]/info
...
@@ -185,7 +185,7 @@ http://IP:[server.port]/info
### 获取本地节点可访问其他节点(根据服务名)的路由信息列表
### 获取本地节点可访问其他节点(根据服务名)的路由信息列表
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"/route/{routeServiceId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/route/{routeServiceId}"
,
method
=
RequestMethod
.
GET
)
public
List
<
RouterEntity
>
route
(
@PathVariable
(
value
=
"routeServiceId"
)
String
routeServiceId
)
public
List
<
RouterEntity
>
route
(
@PathVariable
(
value
=
"routeServiceId"
)
String
routeServiceId
)
...
@@ -195,7 +195,7 @@ http://IP:[server.port]/route/{routeServiceId}
...
@@ -195,7 +195,7 @@ http://IP:[server.port]/route/{routeServiceId}
### 获取指定节点(根据IP和端口)可访问其他节点(根据服务名)的路由信息列表
### 获取指定节点(根据IP和端口)可访问其他节点(根据服务名)的路由信息列表
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"/route/{routeServiceId}/{routeHost}/{routePort}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/route/{routeServiceId}/{routeHost}/{routePort}"
,
method
=
RequestMethod
.
GET
)
public
List
<
RouterEntity
>
route
(
@PathVariable
(
value
=
"routeServiceId"
)
String
routeServiceId
,
@PathVariable
(
value
=
"routeHost"
)
String
routeHost
,
@PathVariable
(
value
=
"routePort"
)
int
routePort
)
public
List
<
RouterEntity
>
route
(
@PathVariable
(
value
=
"routeServiceId"
)
String
routeServiceId
,
@PathVariable
(
value
=
"routeHost"
)
String
routeHost
,
@PathVariable
(
value
=
"routePort"
)
int
routePort
)
...
@@ -205,7 +205,7 @@ http://IP:[server.port]/route/{routeServiceId}/{routeHost}/{routePort}
...
@@ -205,7 +205,7 @@ http://IP:[server.port]/route/{routeServiceId}/{routeHost}/{routePort}
### 获取全路径的路由信息(serviceIds按调用服务名的前后次序排列,起始节点的服务名不能加上去。如果多个用“;”分隔,不允许出现空格)
### 获取全路径的路由信息(serviceIds按调用服务名的前后次序排列,起始节点的服务名不能加上去。如果多个用“;”分隔,不允许出现空格)
```
java
```
java
Java
:
Java
:
@RequestMapping
(
path
=
"/routeAll"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
path
=
"/routeAll"
,
method
=
RequestMethod
.
POST
)
public
RouterEntity
routeAll
(
@RequestBody
String
serviceIds
)
public
RouterEntity
routeAll
(
@RequestBody
String
serviceIds
)
...
@@ -272,6 +272,3 @@ AbstractDiscoveryListener,实现服务发现的扩展和监听
...
@@ -272,6 +272,3 @@ AbstractDiscoveryListener,实现服务发现的扩展和监听
图2
图2


\ No newline at end of file
## 鸣谢
感谢Spring Cloud中国社区刘石明提供支持
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment