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
2e9ff4c7
Commit
2e9ff4c7
authored
Jan 29, 2016
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make eureka application manager @Lazy
So that it isn't instantated eagerly on startup by the RefreshScope. Fixes gh-789
parent
cb13b9dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
EurekaClientAutoConfiguration.java
...k/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
+3
-0
No files found.
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
View file @
2e9ff4c7
...
...
@@ -46,6 +46,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.util.StringUtils
;
...
...
@@ -161,6 +162,7 @@ public class EurekaClientAutoConfiguration {
@Bean
(
destroyMethod
=
"shutdown"
)
@ConditionalOnMissingBean
(
value
=
EurekaClient
.
class
,
search
=
SearchStrategy
.
CURRENT
)
@org
.
springframework
.
cloud
.
context
.
config
.
annotation
.
RefreshScope
@Lazy
public
EurekaClient
eurekaClient
(
ApplicationInfoManager
applicationInfoManager
,
EurekaClientConfig
config
,
EurekaInstanceConfig
instance
)
{
applicationInfoManager
.
getInfo
();
// force initialization
...
...
@@ -171,6 +173,7 @@ public class EurekaClientAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
value
=
ApplicationInfoManager
.
class
,
search
=
SearchStrategy
.
CURRENT
)
@org
.
springframework
.
cloud
.
context
.
config
.
annotation
.
RefreshScope
@Lazy
public
ApplicationInfoManager
eurekaApplicationInfoManager
(
EurekaInstanceConfig
config
)
{
InstanceInfo
instanceInfo
=
new
InstanceInfoFactory
().
create
(
config
);
...
...
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