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
1f63ea91
Commit
1f63ea91
authored
Aug 14, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build and fix race in eureka
parent
c8be52b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
EurekaClientConfiguration.java
...rk/platform/netflix/eureka/EurekaClientConfiguration.java
+5
-0
EurekaInstanceConfigBean.java
...ork/platform/netflix/eureka/EurekaInstanceConfigBean.java
+8
-2
No files found.
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/eureka/EurekaClientConfiguration.java
View file @
1f63ea91
...
@@ -27,6 +27,9 @@ import org.springframework.context.ApplicationListener;
...
@@ -27,6 +27,9 @@ import org.springframework.context.ApplicationListener;
import
org.springframework.context.SmartLifecycle
;
import
org.springframework.context.SmartLifecycle
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.context.annotation.ScopedProxyMode
;
import
org.springframework.context.event.ContextRefreshedEvent
;
import
org.springframework.context.event.ContextRefreshedEvent
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
...
@@ -109,6 +112,8 @@ public class EurekaClientConfiguration implements
...
@@ -109,6 +112,8 @@ public class EurekaClientConfiguration implements
}
}
@Bean
@Bean
@Lazy
@Scope
(
proxyMode
=
ScopedProxyMode
.
TARGET_CLASS
)
public
DiscoveryClient
discoveryClient
()
{
public
DiscoveryClient
discoveryClient
()
{
return
DiscoveryManager
.
getInstance
().
getDiscoveryClient
();
return
DiscoveryManager
.
getInstance
().
getDiscoveryClient
();
}
}
...
...
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/eureka/EurekaInstanceConfigBean.java
View file @
1f63ea91
...
@@ -66,7 +66,7 @@ public class EurekaInstanceConfigBean implements EurekaInstanceConfig {
...
@@ -66,7 +66,7 @@ public class EurekaInstanceConfigBean implements EurekaInstanceConfig {
private
int
leaseExpirationDurationInSeconds
=
90
;
private
int
leaseExpirationDurationInSeconds
=
90
;
@Value
(
"${spring.application.name:unknown}"
)
//TODO: why is .mydomain.net here?
@Value
(
"${spring.application.name:unknown}"
)
private
String
virtualHostName
;
private
String
virtualHostName
;
private
String
secureVirtualHostName
;
private
String
secureVirtualHostName
;
...
@@ -99,6 +99,12 @@ public class EurekaInstanceConfigBean implements EurekaInstanceConfig {
...
@@ -99,6 +99,12 @@ public class EurekaInstanceConfigBean implements EurekaInstanceConfig {
private
String
namespace
=
"eureka"
;
private
String
namespace
=
"eureka"
;
private
String
hostname
=
hostInfo
[
1
];
private
String
hostname
=
hostInfo
[
1
];
private
boolean
preferIpAddress
=
false
;
public
String
getHostname
()
{
return
preferIpAddress
?
ipAddress
:
hostname
;
}
@Override
@Override
public
boolean
getSecurePortEnabled
()
{
public
boolean
getSecurePortEnabled
()
{
...
@@ -118,7 +124,7 @@ public class EurekaInstanceConfigBean implements EurekaInstanceConfig {
...
@@ -118,7 +124,7 @@ public class EurekaInstanceConfigBean implements EurekaInstanceConfig {
@Override
@Override
public
String
getHostName
(
boolean
refresh
)
{
public
String
getHostName
(
boolean
refresh
)
{
return
hostname
;
return
preferIpAddress
?
ipAddress
:
hostname
;
}
}
}
}
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