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
cfb31419
Unverified
Commit
cfb31419
authored
Jun 06, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge fixes
parent
74ff6595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
EurekaClientAutoConfiguration.java
...k/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
+12
-4
No files found.
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
View file @
cfb31419
...
...
@@ -25,6 +25,8 @@ import java.lang.annotation.Target;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.actuate.endpoint.Endpoint
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
...
...
@@ -84,6 +86,8 @@ import static org.springframework.cloud.commons.util.IdUtils.getDefaultInstanceI
@AutoConfigureAfter
(
name
=
"org.springframework.cloud.autoconfigure.RefreshAutoConfiguration"
)
public
class
EurekaClientAutoConfiguration
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
EurekaClientAutoConfiguration
.
class
);
private
ConfigurableEnvironment
env
;
@Autowired
(
required
=
false
)
private
HealthCheckHandler
healthCheckHandler
;
...
...
@@ -123,7 +127,7 @@ public class EurekaClientAutoConfiguration {
String
managementContextPath
=
env
.
getProperty
(
"management.context-path"
,
env
.
getProperty
(
"server.servlet.context-path"
,
"/"
));
EurekaInstanceConfigBean
instance
=
new
EurekaInstanceConfigBean
(
inetUtils
);
instance
.
setNonSecurePort
(
nonSecurePort
);
instance
.
setInstanceId
(
getDefaultInstanceId
(
propertyResolver
));
instance
.
setInstanceId
(
getDefaultInstanceId
(
env
));
instance
.
setPreferIpAddress
(
preferIpAddress
);
if
(
managementPort
!=
nonSecurePort
&&
managementPort
!=
0
)
{
if
(
StringUtils
.
hasText
(
hostname
))
{
...
...
@@ -141,9 +145,13 @@ public class EurekaClientAutoConfiguration {
instance
.
setHealthCheckUrlPath
(
healthCheckUrlPath
);
}
String
scheme
=
instance
.
getSecurePortEnabled
()
?
"https"
:
"http"
;
URL
base
=
new
URL
(
scheme
,
instance
.
getHostname
(),
managementPort
,
managementContextPath
);
instance
.
setStatusPageUrl
(
new
URL
(
base
,
StringUtils
.
trimLeadingCharacter
(
instance
.
getStatusPageUrlPath
(),
'/'
)).
toString
());
instance
.
setHealthCheckUrl
(
new
URL
(
base
,
StringUtils
.
trimLeadingCharacter
(
instance
.
getHealthCheckUrlPath
(),
'/'
)).
toString
());
try
{
URL
base
=
new
URL
(
scheme
,
instance
.
getHostname
(),
managementPort
,
managementContextPath
);
instance
.
setStatusPageUrl
(
new
URL
(
base
,
StringUtils
.
trimLeadingCharacter
(
instance
.
getStatusPageUrlPath
(),
'/'
)).
toString
());
instance
.
setHealthCheckUrl
(
new
URL
(
base
,
StringUtils
.
trimLeadingCharacter
(
instance
.
getHealthCheckUrlPath
(),
'/'
)).
toString
());
}
catch
(
MalformedURLException
e
)
{
log
.
error
(
"Unable to set status page or health check url."
,
e
);
}
}
return
instance
;
}
...
...
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