Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
8147b7de
Commit
8147b7de
authored
Oct 07, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #575 from alexVengrovsk/master
* pull575: Use "<>" and use isInfoEnabled
parents
810502c1
4510f657
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
EurekaClientConfigBean.java
...ramework/cloud/netflix/eureka/EurekaClientConfigBean.java
+1
-1
EurekaDiscoveryClientConfiguration.java
...ud/netflix/eureka/EurekaDiscoveryClientConfiguration.java
+7
-0
InstanceInfoFactory.java
...ngframework/cloud/netflix/eureka/InstanceInfoFactory.java
+4
-0
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientConfigBean.java
View file @
8147b7de
...
@@ -110,7 +110,7 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
...
@@ -110,7 +110,7 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
private
String
fetchRemoteRegionsRegistry
;
private
String
fetchRemoteRegionsRegistry
;
private
Map
<
String
,
String
>
availabilityZones
=
new
HashMap
<
String
,
String
>();
private
Map
<
String
,
String
>
availabilityZones
=
new
HashMap
<>();
private
boolean
filterOnlyUpInstances
=
true
;
private
boolean
filterOnlyUpInstances
=
true
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClientConfiguration.java
View file @
8147b7de
...
@@ -95,9 +95,12 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
...
@@ -95,9 +95,12 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
if
(!
this
.
running
.
get
()
&&
this
.
instanceConfig
.
getNonSecurePort
()
>
0
)
{
if
(!
this
.
running
.
get
()
&&
this
.
instanceConfig
.
getNonSecurePort
()
>
0
)
{
this
.
eurekaClient
.
getApplications
();
// force initialization
this
.
eurekaClient
.
getApplications
();
// force initialization
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"Registering application "
+
this
.
instanceConfig
.
getAppname
()
log
.
info
(
"Registering application "
+
this
.
instanceConfig
.
getAppname
()
+
" with eureka with status "
+
" with eureka with status "
+
this
.
instanceConfig
.
getInitialStatus
());
+
this
.
instanceConfig
.
getInitialStatus
());
}
this
.
applicationInfoManager
this
.
applicationInfoManager
.
setInstanceStatus
(
this
.
instanceConfig
.
getInitialStatus
());
.
setInstanceStatus
(
this
.
instanceConfig
.
getInitialStatus
());
...
@@ -114,8 +117,12 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
...
@@ -114,8 +117,12 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
@Override
@Override
public
void
stop
()
{
public
void
stop
()
{
if
(
this
.
applicationInfoManager
.
getInfo
()
!=
null
)
{
if
(
this
.
applicationInfoManager
.
getInfo
()
!=
null
)
{
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"Unregistering application "
+
this
.
instanceConfig
.
getAppname
()
log
.
info
(
"Unregistering application "
+
this
.
instanceConfig
.
getAppname
()
+
" with eureka with status DOWN"
);
+
" with eureka with status DOWN"
);
}
this
.
applicationInfoManager
.
setInstanceStatus
(
InstanceStatus
.
DOWN
);
this
.
applicationInfoManager
.
setInstanceStatus
(
InstanceStatus
.
DOWN
);
}
}
this
.
running
.
set
(
false
);
this
.
running
.
set
(
false
);
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/InstanceInfoFactory.java
View file @
8147b7de
...
@@ -64,15 +64,19 @@ public class InstanceInfoFactory {
...
@@ -64,15 +64,19 @@ public class InstanceInfoFactory {
// Start off with the STARTING state to avoid traffic
// Start off with the STARTING state to avoid traffic
if
(!
config
.
isInstanceEnabledOnit
())
{
if
(!
config
.
isInstanceEnabledOnit
())
{
InstanceInfo
.
InstanceStatus
initialStatus
=
InstanceInfo
.
InstanceStatus
.
STARTING
;
InstanceInfo
.
InstanceStatus
initialStatus
=
InstanceInfo
.
InstanceStatus
.
STARTING
;
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"Setting initial instance status as: "
+
initialStatus
);
log
.
info
(
"Setting initial instance status as: "
+
initialStatus
);
}
builder
.
setStatus
(
initialStatus
);
builder
.
setStatus
(
initialStatus
);
}
}
else
{
else
{
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"Setting initial instance status as: "
log
.
info
(
"Setting initial instance status as: "
+
InstanceInfo
.
InstanceStatus
.
UP
+
InstanceInfo
.
InstanceStatus
.
UP
+
". This may be too early for the instance to advertise itself as available. "
+
". This may be too early for the instance to advertise itself as available. "
+
"You would instead want to control this via a healthcheck handler."
);
+
"You would instead want to control this via a healthcheck handler."
);
}
}
}
// Add any user-specific metadata information
// Add any user-specific metadata information
for
(
Map
.
Entry
<
String
,
String
>
mapEntry
:
config
.
getMetadataMap
().
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
mapEntry
:
config
.
getMetadataMap
().
entrySet
())
{
...
...
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