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
187af715
Commit
187af715
authored
Sep 29, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move refs to EurekaInstanceConfigBean to interface.
Specifically CloudEurekaInstanceConfig where needed. see gh-302
parent
4877de49
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
8 deletions
+36
-8
EurekaClientConfigServerAutoConfiguration.java
...lix/config/EurekaClientConfigServerAutoConfiguration.java
+2
-1
CloudEurekaInstanceConfig.java
...ework/cloud/netflix/eureka/CloudEurekaInstanceConfig.java
+28
-0
EurekaDiscoveryClientConfiguration.java
...ud/netflix/eureka/EurekaDiscoveryClientConfiguration.java
+1
-1
EurekaInstanceConfigBean.java
...mework/cloud/netflix/eureka/EurekaInstanceConfigBean.java
+1
-2
EurekaRibbonClientConfiguration.java
...etflix/ribbon/eureka/EurekaRibbonClientConfiguration.java
+4
-4
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/config/EurekaClientConfigServerAutoConfiguration.java
View file @
187af715
...
...
@@ -26,6 +26,7 @@ import org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.StringUtils
;
import
com.netflix.appinfo.EurekaInstanceConfig
;
import
com.netflix.discovery.EurekaClient
;
/**
...
...
@@ -40,7 +41,7 @@ import com.netflix.discovery.EurekaClient;
public
class
EurekaClientConfigServerAutoConfiguration
{
@Autowired
(
required
=
false
)
private
EurekaInstanceConfig
Bean
instance
;
private
EurekaInstanceConfig
instance
;
@Autowired
(
required
=
false
)
private
ConfigServerProperties
server
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/CloudEurekaInstanceConfig.java
0 → 100644
View file @
187af715
/*
* Copyright 2013-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
cloud
.
netflix
.
eureka
;
import
com.netflix.appinfo.EurekaInstanceConfig
;
import
com.netflix.appinfo.InstanceInfo
;
/**
* @author Spencer Gibb
*/
public
interface
CloudEurekaInstanceConfig
extends
EurekaInstanceConfig
{
void
setNonSecurePort
(
int
port
);
InstanceInfo
.
InstanceStatus
getInitialStatus
();
}
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClientConfiguration.java
View file @
187af715
...
...
@@ -69,7 +69,7 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
private
AtomicInteger
port
=
new
AtomicInteger
(
0
);
@Autowired
private
EurekaInstanceConfigBean
instanceConfig
;
private
CloudEurekaInstanceConfig
instanceConfig
;
@Autowired
(
required
=
false
)
private
HealthCheckHandler
healthCheckHandler
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBean.java
View file @
187af715
...
...
@@ -33,7 +33,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import
org.springframework.cloud.util.InetUtils.HostInfo
;
import
com.netflix.appinfo.DataCenterInfo
;
import
com.netflix.appinfo.EurekaInstanceConfig
;
import
com.netflix.appinfo.InstanceInfo.InstanceStatus
;
import
com.netflix.appinfo.MyDataCenterInfo
;
...
...
@@ -43,7 +42,7 @@ import com.netflix.appinfo.MyDataCenterInfo;
*/
@Data
@ConfigurationProperties
(
"eureka.instance"
)
public
class
EurekaInstanceConfigBean
implements
EurekaInstanceConfig
{
public
class
EurekaInstanceConfigBean
implements
Cloud
EurekaInstanceConfig
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
EurekaInstanceConfigBean
.
class
);
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/eureka/EurekaRibbonClientConfiguration.java
View file @
187af715
...
...
@@ -26,12 +26,12 @@ import lombok.extern.apachecommons.CommonsLog;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean
;
import
org.springframework.cloud.netflix.ribbon.ServerIntrospector
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.StringUtils
;
import
com.netflix.appinfo.EurekaInstanceConfig
;
import
com.netflix.client.config.IClientConfig
;
import
com.netflix.config.ConfigurationManager
;
import
com.netflix.config.DeploymentContext.ContextKey
;
...
...
@@ -70,13 +70,13 @@ public class EurekaRibbonClientConfiguration {
private
EurekaClientConfig
clientConfig
;
@Autowired
private
EurekaInstanceConfig
Bean
eurekaConfig
;
private
EurekaInstanceConfig
eurekaConfig
;
public
EurekaRibbonClientConfiguration
()
{
}
public
EurekaRibbonClientConfiguration
(
EurekaClientConfig
clientConfig
,
String
serviceId
,
EurekaInstanceConfig
Bean
eurekaConfig
,
String
serviceId
,
EurekaInstanceConfig
eurekaConfig
,
boolean
approximateZoneFromHostname
)
{
this
.
clientConfig
=
clientConfig
;
this
.
serviceId
=
serviceId
;
...
...
@@ -114,7 +114,7 @@ public class EurekaRibbonClientConfiguration {
if
(
this
.
clientConfig
!=
null
&&
StringUtils
.
isEmpty
(
zone
))
{
if
(
approximateZoneFromHostname
)
{
String
approxZone
=
ZoneUtils
.
extractApproximateZone
(
eurekaConfig
.
getHost
name
(
));
.
getHost
Name
(
false
));
log
.
debug
(
"Setting Zone To "
+
approxZone
);
ConfigurationManager
.
getDeploymentContext
().
setValue
(
ContextKey
.
zone
,
approxZone
);
...
...
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