Commit 7f7c4258 by Nepxion

去掉模拟更新功能

parent ebc2c4c0
......@@ -125,7 +125,7 @@ public class DiscoveryConfigAdapter extends ConfigAdapter {
// 订阅远程配置中心的配置更新
@PostConstruct
public void initialize() {
public void publish() {
InputStream inputStream = ...;
publish(inputStream);
......@@ -207,9 +207,9 @@ management.security.enabled=false
```xml
1. 运行discovery-springcloud-example-b1、discovery-springcloud-example-b2和discovery-springcloud-example-b3下的DiscoveryApplication.java,
2. 运行discovery-springcloud-example-a/DiscoveryApplication.java
3. 通过Postman或者浏览器,访问http://localhost:4321/instances,看到当前时刻,A服务可访问B服务的列表,如图1
4. 通过模拟定时更新,或者执行POST http://localhost:5432/admin/config,发送的内容即规则XML,更改相关规则,如图2
5. 通过Postman或者浏览器,访问http://localhost:4321/admin/view,看到当前时刻,在A服务已经生效的规则,如图3
3. 通过Postman或者浏览器,执行GET http://localhost:4321/instances,看到当前时刻,A服务可访问B服务的列表,如图1
4. 通过Postman或者浏览器,执行POST http://localhost:5432/admin/config,发送的内容即规则XML,更改相关规则,如图2
5. 通过Postman或者浏览器,执行GET http://localhost:4321/admin/view,看到当前时刻,在A服务已经生效的规则,如图3
```
图1
......
......@@ -12,11 +12,6 @@ package com.nepxion.discovery.plugin.example.impl;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ThreadLocalRandom;
import javax.annotation.PostConstruct;
import org.apache.commons.io.FileUtils;
......@@ -49,8 +44,8 @@ public class DiscoveryConfigAdapter extends ConfigAdapter {
}
// 订阅远程配置中心的配置更新
@PostConstruct
public void initialize() {
/*@PostConstruct
public void publish() {
ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current();
// 模拟每隔15秒通过EventBus接收远程配置中心推送过来的配置更新
......@@ -68,5 +63,5 @@ public class DiscoveryConfigAdapter extends ConfigAdapter {
}
}, 10000L, 15000L);
}
}*/
}
\ No newline at end of file
......@@ -22,7 +22,7 @@
</modules>
<properties>
<eventbus.version>1.0.10</eventbus.version>
<eventbus.version>1.0.11</eventbus.version>
<commons.lang3.version>3.6</commons.lang3.version>
<commons.collections4.version>4.1</commons.collections4.version>
<commons.io.version>2.5</commons.io.version>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment