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
4c271ffc
Commit
4c271ffc
authored
Jun 23, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构类结构
parent
52317fdc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/AdminEndpoint.java
+1
-1
discovery-plugin-config-center/src/main/java/com/nepxion/discovery/plugin/configcenter/ConfigSubscriber.java
+1
-1
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/DiscoveryClientDecorator.java
+1
-1
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/EurekaServiceRegistryDecorator.java
+1
-1
discovery-springcloud-example-a/src/main/resources/application.properties
+4
-3
No files found.
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/AdminEndpoint.java
View file @
4c271ffc
...
...
@@ -58,7 +58,7 @@ public class AdminEndpoint implements MvcEndpoint, ApplicationContextAware, Envi
@RequestMapping
(
path
=
"filter"
,
method
=
RequestMethod
.
GET
)
@ManagedOperation
public
Object
filter
(
@RequestParam
(
"serviceId"
)
String
serviceId
,
@RequestParam
(
"ip"
)
String
ip
)
{
Boolean
discoveryControlEnabled
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
,
Boolean
.
class
);
Boolean
discoveryControlEnabled
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
,
Boolean
.
class
,
Boolean
.
TRUE
);
if
(!
discoveryControlEnabled
)
{
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
}
...
...
discovery-plugin-config-center/src/main/java/com/nepxion/discovery/plugin/configcenter/ConfigSubscriber.java
View file @
4c271ffc
...
...
@@ -32,7 +32,7 @@ import com.nepxion.eventbus.core.Event;
public
class
ConfigSubscriber
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ConfigSubscriber
.
class
);
@Value
(
"${"
+
ConfigConstant
.
SPRING_APPLICATION_DISCOVERY_REMOTE_CONFIG_ENABLED
+
":
fals
e}"
)
@Value
(
"${"
+
ConfigConstant
.
SPRING_APPLICATION_DISCOVERY_REMOTE_CONFIG_ENABLED
+
":
tru
e}"
)
private
Boolean
remoteConfigEnabled
;
@Autowired
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/DiscoveryClientDecorator.java
View file @
4c271ffc
...
...
@@ -45,7 +45,7 @@ public class DiscoveryClientDecorator implements DiscoveryClient {
public
List
<
ServiceInstance
>
getInstances
(
String
serviceId
)
{
List
<
ServiceInstance
>
instances
=
discoveryClient
.
getInstances
(
serviceId
);
Boolean
discoveryControlEnabled
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
,
Boolean
.
class
);
Boolean
discoveryControlEnabled
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
,
Boolean
.
class
,
Boolean
.
TRUE
);
if
(
discoveryControlEnabled
)
{
String
applicationName
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_NAME
);
String
metadataVersion
=
environment
.
getProperty
(
PluginConstant
.
EUREKA_METADATA_VERSION
);
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/EurekaServiceRegistryDecorator.java
View file @
4c271ffc
...
...
@@ -31,7 +31,7 @@ public class EurekaServiceRegistryDecorator extends EurekaServiceRegistry {
@Override
public
void
register
(
EurekaRegistration
registration
)
{
Boolean
registerControlEnabled
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_REGISTER_CONTROL_ENABLED
,
Boolean
.
class
);
Boolean
registerControlEnabled
=
environment
.
getProperty
(
PluginConstant
.
SPRING_APPLICATION_REGISTER_CONTROL_ENABLED
,
Boolean
.
class
,
Boolean
.
TRUE
);
if
(
registerControlEnabled
)
{
String
serviceId
=
registration
.
getServiceId
();
String
ipAddress
=
registration
.
getInstanceConfig
().
getIpAddress
();
...
...
discovery-springcloud-example-a/src/main/resources/application.properties
View file @
4c271ffc
...
...
@@ -6,13 +6,13 @@ eureka.instance.preferIpAddress=true
eureka.instance.metadataMap.version
=
1.0
# Plugin config
# 开启和关闭服务注册层面的控制。一旦关闭,服务注册的黑/白名单过滤功能将失效
# 开启和关闭服务注册层面的控制。一旦关闭,服务注册的黑/白名单过滤功能将失效
。缺失则默认为true
spring.application.register.control.enabled
=
true
# 开启和关闭服务发现层面的控制。一旦关闭,服务多版本调用的控制功能将失效,动态屏蔽指定IP地址的服务示例功能将失效
# 开启和关闭服务发现层面的控制。一旦关闭,服务多版本调用的控制功能将失效,动态屏蔽指定IP地址的服务示例功能将失效
。缺失则默认为true
spring.application.discovery.control.enabled
=
true
# 开启和关闭远程配置中心规则配置文件读取。一旦关闭,默认读取本地规则配置文件(例如:rule.xml)
# 开启和关闭远程配置中心规则配置文件读取。一旦关闭,默认读取本地规则配置文件(例如:rule.xml)
。缺失则默认为true
spring.application.discovery.remote.config.enabled
=
true
management.security.enabled
=
false
\ No newline at end of file
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