├── application.properties ├── hystrix-dashboard.properties ├── eureka-service.properties ├── reservation-data-seeder.properties ├── reservation-client.properties ├── reservation-service.properties ├── LICENSE.txt ├── .gitignore └── README.md /application.properties: -------------------------------------------------------------------------------- 1 | # global app props 2 | #server.port=0 3 | -------------------------------------------------------------------------------- /hystrix-dashboard.properties: -------------------------------------------------------------------------------- 1 | # hystrix dashboard app props 2 | server.port=8010 3 | -------------------------------------------------------------------------------- /eureka-service.properties: -------------------------------------------------------------------------------- 1 | # eureka service app props 2 | server.port=8761 3 | 4 | # The settings registerWithEureka and fetchRegistry are set to false, 5 | # meaning that this Server is not part of a cluster. 6 | eureka.client.register-with-eureka=false 7 | eureka.client.fetch-registry=false 8 | -------------------------------------------------------------------------------- /reservation-data-seeder.properties: -------------------------------------------------------------------------------- 1 | # reservation data seeder app props 2 | # h2 database server 3 | spring.datasource.url=jdbc:h2:tcp://localhost/~/reservationdb 4 | spring.datasource.username=dbuser 5 | spring.datasource.password=dbpass 6 | spring.datasource.driver-class-name=org.h2.Driver 7 | spring.h2.console.enabled=true 8 | spring.jpa.hibernate.ddl-auto=update 9 | -------------------------------------------------------------------------------- /reservation-client.properties: -------------------------------------------------------------------------------- 1 | # reservation client app props 2 | server.port=8050 3 | message=Spring Cloud Config: Reservation Client\n 4 | 5 | # spring cloud stream / redis 6 | spring.cloud.stream.bindings.output=reservations 7 | spring.redis.host=192.168.99.100 8 | spring.redis.port=6379 9 | 10 | # zipkin / spring cloud sleuth 11 | spring.zipkin.host=192.168.99.100 12 | spring.zipkin.port=9410 13 | -------------------------------------------------------------------------------- /reservation-service.properties: -------------------------------------------------------------------------------- 1 | # reservation service app props 2 | message=Spring Cloud Config: Reservation Service\n 3 | 4 | # h2 database server 5 | spring.datasource.url=jdbc:h2:tcp://localhost/~/reservationdb 6 | spring.datasource.username=dbuser 7 | spring.datasource.password=dbpass 8 | spring.datasource.driver-class-name=org.h2.Driver 9 | spring.jpa.hibernate.ddl-auto=validate 10 | 11 | # spring cloud stream / redis 12 | spring.cloud.stream.bindings.input=reservations 13 | spring.redis.host=192.168.99.100 14 | spring.redis.port=6379 15 | 16 | # zipkin / spring cloud sleuth 17 | spring.zipkin.host=192.168.99.100 18 | spring.zipkin.port=9410 19 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/intellij,java 3 | 4 | ### Intellij ### 5 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 6 | 7 | *.iml 8 | 9 | ## Directory-based project format: 10 | .idea/ 11 | # if you remove the above rule, at least ignore the following: 12 | 13 | # User-specific stuff: 14 | # .idea/workspace.xml 15 | # .idea/tasks.xml 16 | # .idea/dictionaries 17 | # .idea/shelf 18 | 19 | # Sensitive or high-churn files: 20 | # .idea/dataSources.ids 21 | # .idea/dataSources.xml 22 | # .idea/sqlDataSources.xml 23 | # .idea/dynamic.xml 24 | # .idea/uiDesigner.xml 25 | 26 | # Gradle: 27 | # .idea/gradle.xml 28 | # .idea/libraries 29 | 30 | # Mongo Explorer plugin: 31 | # .idea/mongoSettings.xml 32 | 33 | ## File-based project format: 34 | *.ipr 35 | *.iws 36 | 37 | ## Plugin-specific files: 38 | 39 | # IntelliJ 40 | /out/ 41 | 42 | # mpeltonen/sbt-idea plugin 43 | .idea_modules/ 44 | 45 | # JIRA plugin 46 | atlassian-ide-plugin.xml 47 | 48 | # Crashlytics plugin (for Android Studio and IntelliJ) 49 | com_crashlytics_export_strings.xml 50 | crashlytics.properties 51 | crashlytics-build.properties 52 | fabric.properties 53 | 54 | 55 | ### Java ### 56 | *.class 57 | 58 | # Mobile Tools for Java (J2ME) 59 | .mtj.tmp/ 60 | 61 | # Package Files # 62 | *.jar 63 | *.war 64 | *.ear 65 | 66 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 67 | hs_err_pid* 68 | 69 | /target/ 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Diving Deeper into ‘Getting Started with Spring Cloud’ 2 | _Explore the integration of Spring Cloud and Spring Cloud Netflix tooling, through a deep dive into Pivotal’s ‘Getting Started with Spring Cloud’ presentation._ 3 | 4 | Project repository for accompanying blog post: [Diving Deeper into ‘Getting Started with Spring Cloud’](http://wp.me/p1RD28-1N1) 5 | 6 | #### Introduction 7 | The presentation, [Getting Started with Spring Cloud](https://youtu.be/cCEvFDhe3os), given by Josh Long and Dr. Dave Syer, at SpringOne2GX 2015, provides an excellent end-to-end technical overview of the latest Spring and Netflix technologies. 8 | 9 | The accompanying post examines the technologies, components, code, and configuration presented in Getting Started with Spring Cloud. The goal of the post is to provide a greater understanding of the Spring Cloud and Spring Cloud Netflix technologies. 10 | 11 | To clone project locally: 12 | ``` 13 | git clone https://github.com/garystafford/spring-cloud-demo-config-repo.git 14 | git clone --recursive https://github.com/garystafford/spring-cloud-demo.git 15 | ``` 16 | 17 | 18 | #### System Overview 19 | 20 | ![Overall System Diagram](https://programmaticponderings.files.wordpress.com/2016/02/reservation-system-diagram.png "Overall System Diagram") 21 | 22 | The presentation’s example introduces a dizzying array of technologies, which include: 23 | 24 | **Spring Boot** 25 | Stand-alone, production-grade Spring-based applications 26 | 27 | **Spring Data REST / Spring HATEOAS** 28 | Spring-based applications following HATEOAS principles 29 | 30 | **Spring Cloud Config** 31 | Centralized external configuration management, backed by Git 32 | 33 | **Netflix Eureka** 34 | REST-based service discovery and registration for failover and load-balancing 35 | 36 | **Netflix Ribbon** 37 | IPC library with built-in client-side software load-balancers 38 | 39 | **Netflix Zuul** 40 | Dynamic routing, monitoring, resiliency, security, and more 41 | 42 | **Netflix Hystrix** 43 | Latency and fault tolerance for distributed system 44 | 45 | **Netflix Hystrix Dashboard** 46 | Web-based UI for monitoring Hystrix 47 | 48 | **Spring Cloud Stream** 49 | Messaging microservices, backed by Redis 50 | 51 | **Spring Data Redis** 52 | Configuration and access to Redis from a Spring app, using Jedis 53 | 54 | **Spring Cloud Sleuth** 55 | Distributed tracing solution for Spring Cloud, sends traces via Thrift to the Zipkin collector service 56 | 57 | **Twitter Zipkin** 58 | Distributed tracing system, backed by Apache Cassandra 59 | 60 | **H2** 61 | In-memory Java SQL database, embedded and server modes 62 | 63 | **Docker** 64 | Package applications with dependencies into standardized Linux containers 65 | 66 | 67 | #### Project URLs 68 | **Reservation Service** 69 | [http://localhost:8000/reservations](http://localhost:8000/reservations) 70 | [http://localhost:8000/reservations/search/by-name?rn=Amit](http://localhost:8000/reservations/search/by-name?rn=Amit) 71 | [http://localhost:8000/configprops](http://localhost:8000/configprops) 72 | [http://localhost:8000/metrics](http://localhost:8000/metrics) 73 | [http://localhost:8000/health](http://localhost:8000/health) 74 | 75 | **Reservation Client** 76 | [http://localhost:8050/reservation-service/reservations](http://localhost:8050/reservation-service/reservations) 77 | [http://localhost:8050/reservations/names](http://localhost:8050/reservations/names) 78 | [http://localhost:8050/reservations](http://localhost:8050/reservations) 79 | [http://localhost:8050/reservations/service-message](http://localhost:8050/reservations/service-message) 80 | [http://localhost:8050/reservations/client-message](http://localhost:8050/reservations/client-message) 81 | 82 | **Eureka Server** 83 | [http://localhost:8761](http://localhost:8761) 84 | 85 | **Spring Cloud Config** 86 | [http://localhost:8888/reservation-service/master](http://localhost:8888/reservation-service/master) 87 | [http://localhost:8888/reservation-client/master](http://localhost:8888/reservation-client/master) 88 | 89 | **Hystrix Dashboard** 90 | [http://localhost:8050/hystrix.stream](http://localhost:8050/hystrix.stream) 91 | [http://localhost:8010/hystrix.html](http://localhost:8010/hystrix.html) 92 | 93 | **Zipkin** 94 | [http://localhost:8080](http://localhost:8080) 95 | [http://192.168.99.101:9990/admin](http://192.168.99.101:9990/admin) 96 | 97 | **H2** 98 | [http://192.168.99.1:6889](http://192.168.99.1:6889) 99 | --------------------------------------------------------------------------------