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
e1bd565d
Commit
e1bd565d
authored
Jun 24, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消必须提供ConfigLoader的限制
parent
51c7434b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
discovery-plugin-config-center/src/main/java/com/nepxion/discovery/plugin/configcenter/ConfigSubscriber.java
+16
-1
discovery-springcloud-example-a/src/main/resources/rule1.xml
+2
-1
No files found.
discovery-plugin-config-center/src/main/java/com/nepxion/discovery/plugin/configcenter/ConfigSubscriber.java
View file @
e1bd565d
...
...
@@ -33,13 +33,16 @@ import com.nepxion.eventbus.core.Event;
public
class
ConfigSubscriber
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ConfigSubscriber
.
class
);
@Value
(
"${"
+
PluginConstant
.
SPRING_APPLICATION_REGISTER_CONTROL_ENABLED
+
":true}"
)
private
Boolean
registerControlEnabled
;
@Value
(
"${"
+
PluginConstant
.
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
+
":true}"
)
private
Boolean
discoveryControlEnabled
;
@Value
(
"${"
+
ConfigConstant
.
SPRING_APPLICATION_DISCOVERY_REMOTE_CONFIG_ENABLED
+
":true}"
)
private
Boolean
remoteConfigEnabled
;
@Autowired
@Autowired
(
required
=
false
)
private
ConfigLoader
configLoader
;
@Autowired
...
...
@@ -47,6 +50,18 @@ public class ConfigSubscriber {
@PostConstruct
public
void
initialize
()
{
if
(!
registerControlEnabled
&&
!
discoveryControlEnabled
)
{
LOG
.
info
(
"********** Register and Discovery controls are all disabled, ignore to initialize **********"
);
return
;
}
if
(
configLoader
==
null
)
{
LOG
.
info
(
"********** ConfigLoader isn't provided, ignore to initialize **********"
);
return
;
}
LOG
.
info
(
"********** {} config starts to initialize **********"
,
remoteConfigEnabled
?
"Remote"
:
"Local"
);
InputStream
inputStream
=
null
;
...
...
discovery-springcloud-example-a/src/main/resources/rule1.xml
View file @
e1bd565d
...
...
@@ -45,6 +45,6 @@
<version>
<!-- 表示消费端服务a的1.0,允许访问提供端服务b的1.0和1.1版本 -->
<service
consumer-service-name=
"discovery-springcloud-example-a"
provider-service-name=
"discovery-springcloud-example-b"
consumer-version-value=
"1.0"
provider-version-value=
"1.0,1.1"
/>
</version>
</version>
</discovery>
</rule>
\ 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