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

fixed #950 #951

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions blog/DataSync-SourceCode-Analysis-WebSocket-Data-Sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,9 @@ shenyu:
dubbo :
parameter: multi
sync:
websocket : # Use websocket for data synchronization
urls: ws://localhost:9095/websocket # websocket address of admin
websocket : # Use websocket for data synchronization
urls: ws://localhost:9095/websocket # websocket address of admin
allowOrigin: ws://localhost:9195
```

Add a dependency on websocket in the gateway.
Expand Down
1 change: 1 addition & 0 deletions docs/deployment/deployment-custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //set to your shenyu-admin address
allowOrigin: ws://localhost:9195
```
3 changes: 2 additions & 1 deletion docs/user-guide/property-config/use-data-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ Add these config values in yaml file:
shenyu:
sync:
websocket :
# urls: address of shenyu-admin,multi-address will be separated with (,).
urls: ws://localhost:9095/websocket
#urls: address of shenyu-admin,multi-address will be separated with (,).
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,9 @@ shenyu:
dubbo :
parameter: multi
sync:
websocket : # 使用websocket进行数据同步
urls: ws://localhost:9095/websocket # admin端的websocket地址
websocket : # 使用websocket进行数据同步
urls: ws://localhost:9095/websocket # admin端的websocket地址
allowOrigin: ws://localhost:9195
```

在网关中引入`websocket`的依赖。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,44 @@ description: Apache ShenYu 流量控制设计


具体的介绍与使用请看: [选择器与规则管理](../user-guide/admin-usage/selector-and-rule) 。


```mermaid
stateDiagram-v2
state "插件1..n" as p1
state pc1 <<choice>>
state "选择器1..n" as s1
state sc1 <<choice>>
state "规则1..n" as r1
state rc1 <<choice>>
state "执行规则" as rr1
state rrc1 <<choice>>

[*] --> p1

state p1 {
[*] --> pc1
pc1 --> [*] : 插件未开启<br/>继续执行下一个插件

state s1 {
[*] --> sc1
sc1 --> [*] : 选择器未匹配<br/>继续匹配下一个选择器

state r1 {
[*] --> rc1
rc1 --> [*] : 规则未匹配<br/>继续匹配下一个规则

state rr1 {
[*] --> rrc1
rrc1 --> [*] : 继续执行下一个插件
}
rc1 --> rr1 : 规则已匹配<br/>开始执行规则
}
sc1 --> r1 : 选择器已匹配<br/>开始匹配规则
note left of r1 : 当选择器类型为《全流量》时<br/>该选择器和其下规则<br/>的条件均无效<br/>取末尾规则执行
}
pc1 --> s1 : 插件已开启<br/>开始匹配选择器
note left of s1 : 在一个选择器里,至多只会匹配&执行一条规则
}
note left of p1 : 在一个插件里,至多只会匹配到一个选择器
```
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ soul :
sync:
websocket :
urls: ws://localhost:9095/websocket //设置成你的soul-admin地址
allowOrigin: ws://localhost:9195
```

* 你的项目环境搭建完成,启动你的项目。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ description: 使用不同的数据同步策略
soul :
sync:
websocket :
urls: ws://localhost:9095/websocket
#urls:是指 soul-admin的地址,如果有多个,请使用(,)分割.
# urls:是指 soul-admin的地址,如果有多个,请使用(,)分割.
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

* soul-admin 配置,或在 soul-admin 启动参数中设置 `--soul.sync.websocket=''`,然后重启服务。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //设置成你的 shenyu-admin 地址
allowOrigin: ws://localhost:9195
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ description: 使用不同的数据同步策略
shenyu:
sync:
websocket :
urls: ws://localhost:9095/websocket
# urls:是指 shenyu-admin的地址,如果有多个,请使用(,)分割。
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ soul :
sync:
websocket :
urls: ws://localhost:9095/websocket // set your soul-admin address
allowOrigin: ws://localhost:9195
```

* Environment Setup has finished, now your project is launched.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ description: use different data-sync strategy
soul :
sync:
websocket :
urls: ws://localhost:9095/websocket
#urls: address of soul-admin,multi-address will be splitted with (,).
# urls: address of soul-admin,multi-address will be splitted with (,).
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
```

* soul-admin config, enable this parameter `--soul.sync.websocket=''` in soul admin, then restart service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //set to your shenyu-admin address
allowOrigin: ws://localhost:9195
```
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
3 changes: 2 additions & 1 deletion versioned_docs/version-2.4.0/user-guide/use-data-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Add these config values in yaml file:
shenyu:
sync:
websocket :
# urls: address of shenyu-admin,multi-address will be separated with (,).
urls: ws://localhost:9095/websocket
#urls: address of shenyu-admin,multi-address will be separated with (,).
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //set to your shenyu-admin address
allowOrigin: ws://localhost:9195
```
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
3 changes: 2 additions & 1 deletion versioned_docs/version-2.4.1/user-guide/use-data-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ Add these config values in yaml file:
shenyu:
sync:
websocket :
# urls: address of shenyu-admin,multi-address will be separated with (,).
urls: ws://localhost:9095/websocket
#urls: address of shenyu-admin,multi-address will be separated with (,).
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //set to your shenyu-admin address
allowOrigin: ws://localhost:9195
```
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
3 changes: 2 additions & 1 deletion versioned_docs/version-2.4.2/user-guide/use-data-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ Add these config values in yaml file:
shenyu:
sync:
websocket :
# urls: address of shenyu-admin,multi-address will be separated with (,).
urls: ws://localhost:9095/websocket
#urls: address of shenyu-admin,multi-address will be separated with (,).
allowOrigin: ws://localhost:9195
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-websocket-yml.png" width="80%" height="70%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket //set to your shenyu-admin address
allowOrigin: ws://localhost:9195
```
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ shenyu:
sync:
websocket:
urls: ws://localhost:9095/websocket
allowOrigin: ws://localhost:9195
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
Expand Down
Loading
Loading