Browse Source
Because we were using Lifecycle to kick off the eureka registration the local server port wasn't available yet. The change is to use an ApplicationListener and listen for the event that contains the container with its port instead. Fixes gh-15pull/6/head
4 changed files with 124 additions and 11 deletions
@ -0,0 +1,11 @@ |
|||||||
|
require 'asciidoctor' |
||||||
|
require 'erb' |
||||||
|
|
||||||
|
options = {:mkdirs => true, :safe => :unsafe, :attributes => 'linkcss'} |
||||||
|
|
||||||
|
guard 'shell' do |
||||||
|
watch(/^[A-Za-z].*\.adoc$/) {|m| |
||||||
|
Asciidoctor.render_file('src/main/adoc/README.adoc', options.merge(:to_file => './README.md')) |
||||||
|
Asciidoctor.render_file('src/main/adoc/spring-cloud-netflix.adoc', options.merge(:to_dir => 'target/docs')) |
||||||
|
} |
||||||
|
end |
@ -0,0 +1,80 @@ |
|||||||
|
= Spring Cloud Netflix |
||||||
|
|
||||||
|
This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration |
||||||
|
and binding to the Spring Environment and other Spring programming model idioms. |
||||||
|
|
||||||
|
== Service Discovery: Eureka Clients |
||||||
|
|
||||||
|
Example eureka client: |
||||||
|
|
||||||
|
``` |
||||||
|
@Configuration |
||||||
|
@ComponentScan |
||||||
|
@EnableAutoConfiguration |
||||||
|
@EnableEurekaClient |
||||||
|
@RestController |
||||||
|
public class Application { |
||||||
|
|
||||||
|
@RequestMapping("/") |
||||||
|
public String home() { |
||||||
|
return "Hello world"; |
||||||
|
} |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
new SpringApplicationBuilder(Application.class).web(true).run(args); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
``` |
||||||
|
|
||||||
|
(i.e. utterly normal Spring Boot app). Configuration is required to locate the Eureka server. Example: |
||||||
|
|
||||||
|
``` |
||||||
|
eureka: |
||||||
|
client: |
||||||
|
serviceUrl: |
||||||
|
defaultZone: http://localhost:8080/v2/ |
||||||
|
default.defaultZone: http://localhost:8080/v2/ |
||||||
|
``` |
||||||
|
|
||||||
|
The default application name, virtual host and non-secure port are taken from the `Environment` is |
||||||
|
`${spring.application.name}`, `${spring.application.name}.mydomain.net` and `${server.port}` respectively. |
||||||
|
|
||||||
|
== Service Discovery: Eureka Server |
||||||
|
|
||||||
|
Example eureka server: |
||||||
|
|
||||||
|
``` |
||||||
|
@Configuration |
||||||
|
@EnableAutoConfiguration |
||||||
|
@EnableEurekaServer |
||||||
|
public class Application { |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
new SpringApplicationBuilder(Application.class).web(true).run(args); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
``` |
||||||
|
|
||||||
|
The server has a home page with a UI, and HTTP API endpoints per the |
||||||
|
normal Eureka functionality under `/v2/*`. |
||||||
|
|
||||||
|
Eureka (apache -> tomcat) see https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer[flux capacitor] and https://groups.google.com/forum/?fromgroups#!topic/eureka_netflix/g3p2r7gHnN0[google group discussion]. |
||||||
|
|
||||||
|
== Circuit Breaker: Hystrix Clients |
||||||
|
|
||||||
|
== Circuit Breaker: Hystrix Dashboard |
||||||
|
|
||||||
|
=== Turbine |
||||||
|
|
||||||
|
== Declarative REST Client: Feign |
||||||
|
|
||||||
|
== Client Side Load Balancer: Ribbon |
||||||
|
|
||||||
|
== External Configuration: Archaius |
||||||
|
|
||||||
|
== Router and Filter: Zuul |
||||||
|
|
Loading…
Reference in new issue