From 9f8b56d3d5dba2837e2cef6d9cecf3904147e513 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 29 Sep 2014 16:44:15 +0100 Subject: [PATCH] Make readme generator more flexible --- TODO.md | 22 ++++++++++++++++++++++ src/main/asciidoc/README.adoc | 31 ++++++++++--------------------- src/main/asciidoc/intro.adoc | 6 +++++- src/main/ruby/generate_readme.sh | 13 +++++++++++-- src/main/ruby/readme.rb | 14 ++++++++------ 5 files changed, 56 insertions(+), 30 deletions(-) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..06b99147 --- /dev/null +++ b/TODO.md @@ -0,0 +1,22 @@ +## TODO List + +- [x] Example front end app (currently in sandbox) +- [x] Example back end service (currently in sandbox) +- [x] Use platform config +- [x] Hystrix integration (hystrix-javanica) +- [x] Feign use spring message converters +- [x] Ribbon (static server list) +- [x] Eureka boot app (Service registration) +- [x] Eureka (apache -> tomcat) see https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer and https://groups.google.com/forum/?fromgroups#!topic/eureka_netflix/g3p2r7gHnN0 +- [x] Archaius bridge to spring environment +- [x] Ribbon (Client side load balancing) (Eureka integration) + - [x] Remove need for *-eureka.properties + - [ ] Use spring boot values as defaults where appropriate + - [x] Synchronous removal of service from eureka on shutdown +- [x] Refresh log levels dynamically +- [x] Router (Zuul) integrated using hystrix/ribbon/eureka +- [ ] Better observable example +- [ ] Distributed refresh environment via platform bus +- [x] Metrics aggregation (turbine) + - [x] Use Eureka for instance discovery rather than static list see https://github.com/Netflix/Turbine/blob/master/turbine-contrib/src/main/java/com/netflix/turbine/discovery/EurekaInstanceDiscovery.java + - [ ] Configure InstanceDiscovery.impl using auto config/config props diff --git a/src/main/asciidoc/README.adoc b/src/main/asciidoc/README.adoc index 43081d2e..f4530826 100644 --- a/src/main/asciidoc/README.adoc +++ b/src/main/asciidoc/README.adoc @@ -1,25 +1,14 @@ include::intro.adoc[] -== TODO List +== Features + +* Service Discovery: Eureka instances can be registered and clients can discover the instances using Spring-managed beans +* Service Discovery: an embedded Eureka server can be created with declarative Java configuration +* Circuit Breaker: Hystrix clients can be built with a simple annotation-driven method decorator +* Circuit Breaker: embedded Hystrix dashboard with declarative Java configuration +* Declarative REST Client: Feign creates a dynamic implementation of an interface decorated with JAX-RS or Spring MVC annotations +* Client Side Load Balancer: Ribbon +* External Configuration: a bridge from the Sprnig Environment to Archaius (enabls native configuration of Netflix components using Spring Boot conventions) +* Router and Filter: automatic regsitration of Zuul filters,a nd a simple convention over configuration approach to reverse proxy creation -- [x] Example front end app (currently in sandbox) -- [x] Example back end service (currently in sandbox) -- [x] Use platform config -- [x] Hystrix integration (hystrix-javanica) -- [x] Feign use spring message converters -- [x] Ribbon (static server list) -- [x] Eureka boot app (Service registration) -- [x] Eureka (apache -> tomcat) see https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer and https://groups.google.com/forum/?fromgroups#!topic/eureka_netflix/g3p2r7gHnN0 -- [x] Archaius bridge to spring environment -- [x] Ribbon (Client side load balancing) (Eureka integration) - - [x] Remove need for *-eureka.properties - - [ ] Use spring boot values as defaults where appropriate - - [x] Synchronous removal of service from eureka on shutdown -- [x] Refresh log levels dynamically -- [x] Router (Zuul) integrated using hystrix/ribbon/eureka -- [ ] Better observable example -- [ ] Distributed refresh environment via platform bus -- [x] Metrics aggregation (turbine) - - [x] Use Eureka for instance discovery rather than static list see https://github.com/Netflix/Turbine/blob/master/turbine-contrib/src/main/java/com/netflix/turbine/discovery/EurekaInstanceDiscovery.java - - [ ] Configure InstanceDiscovery.impl using auto config/config props diff --git a/src/main/asciidoc/intro.adoc b/src/main/asciidoc/intro.adoc index c0b3f029..b2425626 100644 --- a/src/main/asciidoc/intro.adoc +++ b/src/main/asciidoc/intro.adoc @@ -1,3 +1,7 @@ This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration -and binding to the Spring Environment and other Spring programming model idioms. +and binding to the Spring Environment and other Spring programming model idioms. With a few +simple annotations you can quickly enable and configure the common patterns inside your +application and build large distributed systems with battle-tested Netflix components. The +patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix), +Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon). diff --git a/src/main/ruby/generate_readme.sh b/src/main/ruby/generate_readme.sh index a6b3611a..b232502c 100755 --- a/src/main/ruby/generate_readme.sh +++ b/src/main/ruby/generate_readme.sh @@ -3,8 +3,17 @@ base_dir = File.join(File.dirname(__FILE__),'../../..') src_dir = File.join(base_dir, "/src/main/asciidoc") require File.join(File.dirname(__FILE__), 'readme.rb') +require 'optparse' options = {} -ARGV.length > 0 and options[:to_file] = ARGV[0] +input = "#{src_dir}/README.adoc" -SpringCloud::Build.render_file("#{src_dir}/README.adoc", options) +OptionParser.new do |o| + o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' } + o.on('-h', '--help') { puts o; exit } + o.parse! +end + +input = ARGV[0] if ARGV.length>0 + +SpringCloud::Build.render_file(input, options) diff --git a/src/main/ruby/readme.rb b/src/main/ruby/readme.rb index 2f532aa2..083a3b8d 100644 --- a/src/main/ruby/readme.rb +++ b/src/main/ruby/readme.rb @@ -1,3 +1,5 @@ +require 'open-uri' + module SpringCloud module Build @@ -6,13 +8,13 @@ module SpringCloud class << self def process_include out, src, target, attrs - unless target.start_with?('/') - target = File.new(File.join(src, target)) - else - target = File.new(target) + unless target.include?(':') || target.start_with?('/') + target = File.join(src, target) end - target.each do |line| - self.process(out, File.dirname(target), line) + open(target) do |file| + file.each do |line| + self.process(out, File.dirname(target), line) + end end end