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
145b7ce6
Commit
145b7ce6
authored
Sep 25, 2017
by
Ryan Baxter
Committed by
GitHub
Sep 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove @EnableDiscoveryClient and @EnableEurekaClient (#2242)
* Remove @EnableDiscoveryClient and @EnableEurekaClient as there are now optional. Fixes #2241.
parent
c6fa1627
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
12 additions
and
34 deletions
+12
-34
spring-cloud-netflix.adoc
docs/src/main/asciidoc/spring-cloud-netflix.adoc
+7
-7
EnableZuulProxy.java
...g/springframework/cloud/netflix/zuul/EnableZuulProxy.java
+0
-2
EnableEurekaClient.java
...ingframework/cloud/netflix/eureka/EnableEurekaClient.java
+0
-3
EurekaClientAutoConfiguration.java
...k/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
+3
-3
spring.factories
...ureka-client/src/main/resources/META-INF/spring.factories
+2
-3
EurekaHealthCheckTests.java
...ud/netflix/eureka/healthcheck/EurekaHealthCheckTests.java
+0
-2
EurekaSampleApplication.java
.../cloud/netflix/eureka/sample/EurekaSampleApplication.java
+0
-2
RefreshEurekaSampleApplication.java
...netflix/eureka/sample/RefreshEurekaSampleApplication.java
+0
-2
RibbonEurekaAutoConfigurationTests.java
...lix/ribbon/eureka/RibbonEurekaAutoConfigurationTests.java
+0
-2
EnableEurekaServer.java
...ework/cloud/netflix/eureka/server/EnableEurekaServer.java
+0
-2
EnableSidecar.java
.../springframework/cloud/netflix/sidecar/EnableSidecar.java
+0
-2
SidecarClientApplication.java
...ework/cloud/netflix/sidecar/SidecarClientApplication.java
+0
-2
TurbineHttpConfiguration.java
...ework/cloud/netflix/turbine/TurbineHttpConfiguration.java
+0
-2
No files found.
docs/src/main/asciidoc/spring-cloud-netflix.adoc
View file @
145b7ce6
...
...
@@ -38,7 +38,6 @@ Example eureka client:
@
Configuration
@
ComponentScan
@
EnableAutoConfiguration
@
EnableEurekaClient
@
RestController
public
class
Application
{
...
...
@@ -54,9 +53,8 @@ public class Application {
}
----
(
i
.
e
.
utterly
normal
Spring
Boot
app
).
In
this
example
we
use
`@
EnableEurekaClient
`
explicitly
,
but
with
only
Eureka
available
you
could
also
use
`@
EnableDiscoveryClient
`.
Configuration
is
required
to
(
i
.
e
.
utterly
normal
Spring
Boot
app
).
By
having
`
spring
-
cloud
-
starter
-
netflix
-
eureka
-
client
`
on
the
classpath
your
application
will
automatically
register
with
the
Eureka
Server
.
Configuration
is
required
to
locate
the
Eureka
server
.
Example
:
...
...
@@ -76,7 +74,8 @@ The default application name (service ID), virtual host and non-secure
port
,
taken
from
the
`
Environment
`,
are
`${
spring
.
application
.
name
}`,
`${
spring
.
application
.
name
}`
and
`${
server
.
port
}`
respectively
.
`@
EnableEurekaClient
`
makes
the
app
into
both
a
Eureka
"instance"
Having
`
spring
-
cloud
-
starter
-
netflix
-
eureka
-
client
`
on
the
classpath
makes
the
app
into
both
a
Eureka
"instance"
(
i
.
e
.
it
registers
itself
)
and
a
"client"
(
i
.
e
.
it
can
query
the
registry
to
locate
other
services
).
The
instance
behaviour
is
driven
by
`
eureka
.
instance
.*`
configuration
keys
,
but
the
defaults
will
be
...
...
@@ -86,6 +85,8 @@ ID, or VIP).
See
{
github
-
code
}/
spring
-
cloud
-
netflix
-
eureka
-
client
/
src
/
main
/
java
/
org
/
springframework
/
cloud
/
netflix
/
eureka
/
EurekaInstanceConfigBean
.
java
[
EurekaInstanceConfigBean
]
and
{
github
-
code
}/
spring
-
cloud
-
netflix
-
eureka
-
client
/
src
/
main
/
java
/
org
/
springframework
/
cloud
/
netflix
/
eureka
/
EurekaClientConfigBean
.
java
[
EurekaClientConfigBean
]
for
more
details
of
the
configurable
options
.
To
disable
the
Eureka
Discovery
Client
you
can
set
`
eureka
.
client
.
enabled
`
to
`
false
`.
===
Authenticating
with
the
Eureka
Server
HTTP
basic
authentication
will
be
automatically
added
to
your
eureka
...
...
@@ -240,7 +241,7 @@ random value will not be needed.
===
Using
the
EurekaClient
Once
you
have
an
app
that
is
`@
EnableDiscoveryClient
`
(
or
`@
EnableEurekaClient
`)
you
can
use
it
to
Once
you
have
an
app
that
is
a
discovery
client
you
can
use
it
to
discover
service
instances
from
the
<<
spring
-
cloud
-
eureka
-
server
,
Eureka
Server
>>.
One
way
to
do
that
is
to
use
the
native
`
com
.
netflix
.
discovery
.
EurekaClient
`
(
as
opposed
to
the
Spring
...
...
@@ -971,7 +972,6 @@ Example spring boot app
@Configuration
@ComponentScan
@EnableAutoConfiguration
@EnableEurekaClient
@EnableFeignClients
public class Application {
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/EnableZuulProxy.java
View file @
145b7ce6
...
...
@@ -22,7 +22,6 @@ import java.lang.annotation.RetentionPolicy;
import
java.lang.annotation.Target
;
import
org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.Import
;
/**
...
...
@@ -37,7 +36,6 @@ import org.springframework.context.annotation.Import;
* @author Biju Kunjummen
*/
@EnableCircuitBreaker
@EnableDiscoveryClient
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Import
(
ZuulProxyMarkerConfiguration
.
class
)
...
...
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EnableEurekaClient.java
View file @
145b7ce6
...
...
@@ -23,8 +23,6 @@ import java.lang.annotation.Retention;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
/**
* Convenience annotation for clients to enable Eureka discovery configuration
* (specifically). Use this (optionally) in case you want discovery and know for sure that
...
...
@@ -39,7 +37,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Inherited
@EnableDiscoveryClient
public
@interface
EnableEurekaClient
{
}
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java
View file @
145b7ce6
...
...
@@ -71,8 +71,6 @@ import com.netflix.discovery.AbstractDiscoveryClientOptionalArgs;
import
com.netflix.discovery.EurekaClient
;
import
com.netflix.discovery.EurekaClientConfig
;
import
static
org
.
springframework
.
cloud
.
commons
.
util
.
IdUtils
.
getDefaultInstanceId
;
/**
* @author Dave Syer
* @author Spencer Gibb
...
...
@@ -89,7 +87,9 @@ import static org.springframework.cloud.commons.util.IdUtils.getDefaultInstanceI
@ConditionalOnProperty
(
value
=
"eureka.client.enabled"
,
matchIfMissing
=
true
)
@AutoConfigureBefore
({
NoopDiscoveryClientAutoConfiguration
.
class
,
CommonsClientAutoConfiguration
.
class
,
ServiceRegistryAutoConfiguration
.
class
})
@AutoConfigureAfter
(
name
=
"org.springframework.cloud.autoconfigure.RefreshAutoConfiguration"
)
@AutoConfigureAfter
(
name
=
{
"org.springframework.cloud.autoconfigure.RefreshAutoConfiguration"
,
"org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration"
,
"org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration"
})
public
class
EurekaClientAutoConfiguration
{
private
ConfigurableEnvironment
env
;
...
...
spring-cloud-netflix-eureka-client/src/main/resources/META-INF/spring.factories
View file @
145b7ce6
...
...
@@ -2,10 +2,9 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.cloud.netflix.eureka.config.EurekaClientConfigServerAutoConfiguration,\
org.springframework.cloud.netflix.eureka.config.EurekaDiscoveryClientConfigServiceAutoConfiguration,\
org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration,\
org.springframework.cloud.netflix.ribbon.eureka.RibbonEurekaAutoConfiguration
org.springframework.cloud.netflix.ribbon.eureka.RibbonEurekaAutoConfiguration,\
org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration
org.springframework.cloud.bootstrap.BootstrapConfiguration=\
org.springframework.cloud.netflix.eureka.config.EurekaDiscoveryClientConfigServiceBootstrapConfiguration
org.springframework.cloud.client.discovery.EnableDiscoveryClient=\
org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/healthcheck/EurekaHealthCheckTests.java
View file @
145b7ce6
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.actuate.health.HealthIndicator;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
...
...
@@ -62,7 +61,6 @@ public class EurekaHealthCheckTests {
@Configuration
@EnableAutoConfiguration
@EnableEurekaClient
protected
static
class
EurekaHealthCheckApplication
{
@Bean
...
...
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/sample/EurekaSampleApplication.java
View file @
145b7ce6
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.actuate.metrics.repository.InMemoryMetricReposit
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.serviceregistry.ServiceRegistry
;
import
org.springframework.cloud.commons.util.InetUtils
;
import
org.springframework.cloud.netflix.eureka.EurekaClientConfigBean
;
...
...
@@ -48,7 +47,6 @@ import static org.springframework.web.bind.annotation.RequestMethod.POST;
@ComponentScan
@EnableAutoConfiguration
@RestController
@EnableDiscoveryClient
public
class
EurekaSampleApplication
implements
ApplicationContextAware
,
Closeable
{
@Autowired
...
...
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/sample/RefreshEurekaSampleApplication.java
View file @
145b7ce6
...
...
@@ -19,7 +19,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
sample
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.netflix.eureka.CloudEurekaClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
...
...
@@ -37,7 +36,6 @@ import static org.mockito.Mockito.mock;
@ComponentScan
@EnableAutoConfiguration
@RestController
@EnableDiscoveryClient
public
class
RefreshEurekaSampleApplication
{
@Bean
...
...
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/ribbon/eureka/RibbonEurekaAutoConfigurationTests.java
View file @
145b7ce6
...
...
@@ -27,7 +27,6 @@ import org.springframework.boot.SpringBootConfiguration;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.loadbalancer.LoadBalancerClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.test.annotation.DirtiesContext
;
...
...
@@ -56,7 +55,6 @@ public class RibbonEurekaAutoConfigurationTests {
@SpringBootConfiguration
@EnableAutoConfiguration
@EnableDiscoveryClient
public
static
class
EurekaClientDisabledApp
{
@Bean
...
...
spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/EnableEurekaServer.java
View file @
145b7ce6
...
...
@@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.Import
;
/**
...
...
@@ -33,7 +32,6 @@ import org.springframework.context.annotation.Import;
*
*/
@EnableDiscoveryClient
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
...
...
spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/EnableSidecar.java
View file @
145b7ce6
...
...
@@ -23,7 +23,6 @@ import java.lang.annotation.RetentionPolicy;
import
java.lang.annotation.Target
;
import
org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.netflix.zuul.EnableZuulProxy
;
import
org.springframework.context.annotation.Import
;
...
...
@@ -31,7 +30,6 @@ import org.springframework.context.annotation.Import;
* @author Spencer Gibb
*/
@EnableCircuitBreaker
@EnableDiscoveryClient
@EnableZuulProxy
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
...
...
spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarClientApplication.java
View file @
145b7ce6
...
...
@@ -20,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.loadbalancer.LoadBalancerClient
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -30,7 +29,6 @@ import org.springframework.web.bind.annotation.RestController;
* @author Spencer Gibb
*/
@EnableAutoConfiguration
@EnableDiscoveryClient
@Configuration
@RestController
public
class
SidecarClientApplication
{
...
...
spring-cloud-netflix-turbine/src/main/java/org/springframework/cloud/netflix/turbine/TurbineHttpConfiguration.java
View file @
145b7ce6
...
...
@@ -23,7 +23,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.cloud.client.actuator.HasFeatures
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -36,7 +35,6 @@ import com.netflix.turbine.streaming.servlet.TurbineStreamServlet;
*/
@Configuration
@EnableConfigurationProperties
@EnableDiscoveryClient
public
class
TurbineHttpConfiguration
{
@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