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
72c89c51
Commit
72c89c51
authored
Sep 02, 2015
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix autoconfig ordering so that health indicators always work
parent
e31f41c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
EurekaClientAutoConfiguration.java
...k/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
+6
-5
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
View file @
72c89c51
...
...
@@ -21,8 +21,6 @@ import java.util.concurrent.ConcurrentMap;
import
javax.annotation.PostConstruct
;
import
lombok.SneakyThrows
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
...
...
@@ -31,6 +29,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.builder.ParentContextApplicationContextInitializer
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cloud.client.CommonsClientAutoConfiguration
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.client.discovery.event.HeartbeatEvent
;
import
org.springframework.cloud.client.discovery.event.ParentHeartbeatEvent
;
...
...
@@ -48,6 +47,8 @@ import com.netflix.discovery.EurekaClient;
import
com.netflix.discovery.EurekaClientConfig
;
import
com.netflix.discovery.converters.XmlXStream
;
import
lombok.SneakyThrows
;
/**
* @author Dave Syer
*/
...
...
@@ -55,7 +56,7 @@ import com.netflix.discovery.converters.XmlXStream;
@EnableConfigurationProperties
@ConditionalOnClass
(
EurekaClientConfig
.
class
)
@ConditionalOnProperty
(
value
=
"eureka.client.enabled"
,
matchIfMissing
=
true
)
@AutoConfigureBefore
(
NoopDiscoveryClientAutoConfiguration
.
class
)
@AutoConfigureBefore
(
{
NoopDiscoveryClientAutoConfiguration
.
class
,
CommonsClientAutoConfiguration
.
class
}
)
public
class
EurekaClientAutoConfiguration
implements
ApplicationListener
<
ParentContextApplicationContextInitializer
.
ParentContextAvailableEvent
>
{
private
static
final
ConcurrentMap
<
String
,
String
>
listenerAdded
=
new
ConcurrentHashMap
<>();
...
...
@@ -65,7 +66,7 @@ public class EurekaClientAutoConfiguration implements ApplicationListener<Parent
@Value
(
"${server.port:${SERVER_PORT:${PORT:8080}}}"
)
int
nonSecurePort
;
@PostConstruct
public
void
init
()
{
DataCenterAwareJacksonCodec
.
init
();
...
...
@@ -91,7 +92,7 @@ public class EurekaClientAutoConfiguration implements ApplicationListener<Parent
@ConditionalOnMissingBean
(
EurekaClient
.
class
)
@SneakyThrows
public
EurekaClient
eurekaClient
()
{
return
new
CloudEurekaClient
(
applicationInfoManager
(),
eurekaClientConfigBean
(),
context
);
return
new
CloudEurekaClient
(
applicationInfoManager
(),
eurekaClientConfigBean
(),
this
.
context
);
}
@Bean
...
...
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