-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating sqldb-service to data-service with webflux services
- Loading branch information
1 parent
2785bbf
commit 44625f3
Showing
58 changed files
with
924 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
# Spring Micro Services Showcase | ||
[Spring Boot](https://docs.spring.io/spring-boot/docs/1.5.10.RELEASE/reference/htmlsingle/) demonstrates the capabilities of spawning but micro services for all the functionality | ||
including MVC, JPA, Spring Security. | ||
|
||
In this showcase you'll see the following in action: | ||
[Microservices](https://microservices.io/) is an architectural style that structures an application as a collection of loosely coupled services, where each service implements business capabilities. A microservice runs in its own process and communicates other services via HTTP API. Every microservice can be deployed, upgraded, scaled, and restarted independently of the other services in an application. | ||
It enables continuous delivery/deployment of large, complex applications. It allows better component isolation and high resilience against component failures. Smaller components in microservices can be scaled easily to meet increasing demand for a specific component. It increases developer independence and allows parallel development across multiple smaller teams. | ||
Microservices brings additional complexity as the developers have to mitigate fault tolerance, network latency, and deal with load balancing. Also deployment and testing of such a distributed system is complicated and tedious. | ||
|
||
* [Zuul Server](https://cloud.spring.io/spring-cloud-netflix/multi/multi__router_and_filter_zuul.html) | ||
* [Eureka Server](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) | ||
[Spring Boot](https://docs.spring.io/spring-boot/docs/1.5.10.RELEASE/reference/htmlsingle/) enables to spawn stand-alone, production-grade Spring-based Applications with very little configuration, hence it is widely used in micro services arena. It is preconfigured with the Spring's standard configuration and has an embedded Tomcat or Jetty to provide full fledged server functionality. | ||
[Spring Cloud](http://projects.spring.io/spring-cloud/) framework, provides a collection of tools and solutions to some of the commonly encountered patterns when building distributed systems. It addresses solutions for some of the common problems in distributed systems including Configuration management, Service discovery, Circuit breakers and Distributed sessions. | ||
[Docker](https://www.docker.com/) is a open platform to create, deploy, and run applications as a lightweight, portable, self-sufficient container, which can run virtually anywhere. | ||
These tools and platforms form the foundation for spring micro services project. | ||
|
||
To run the application: | ||
------------------- | ||
From the command line with Git and Gradle: | ||
The spring micro services showcase contains the following services in action: | ||
|
||
$ git clone https://github.com/pranav-patil/spring-microservices.git | ||
$ cd spring-microservices | ||
$ gradle clean build | ||
$ java -jar config-server/build/libs/config-server-0.0.1-SNAPSHOT.jar | ||
* [Elastic Stack](elastic-stack/README.md): ElasticSearch-Logstash-Kibana provides log storage and management. | ||
* [Kafka Broker](kafka-broker/README.md): Kafka Message broker provides messaging capabilities to zipkin trace messages to Zipkin server. | ||
* [Zipkin Service](zipkin-service/README.md): Zipkin enables to trace requests spanning across multiple services. | ||
|
||
* [Config Service](config-service/README.md): Configuration service provides access to spring **application.yml** configuration files for corresponding service stored in its centralized (currently local) location. | ||
* [Discovery Service](discovery-service/README.md): Eureka discovery service allows micro services to find and communicate with each other. | ||
* [Authorization Service](authorization-service/README.md): Authorization service is responsible for providing OAuth2 access tokens after authentication and validating request access tokens before allowing access to the authorized services. | ||
* [Data Service](data-service/README.md): Data service provides reactive services using Spring WebFlux to fetch various data (currently stock data). | ||
* [Finance Service](finance-service/README.md): Finance service provides services to fetch financial data especially stock details. | ||
* [Analytics Service](analytics-service/README.md): Analytics services consume data from various sources, mainly finance-service and data-service and provide analytical details regarding the corresponding data. | ||
* [Monitor Service](monitor-service/README.md): Monitor service mainly gathers hystrix circuit breaker data from finance and analytics services, and displays the [Hystrix Dashboard](https://github.com/Netflix-Skunkworks/hystrix-dashboard). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Analytics Service | ||
============= | ||
|
||
Analytics service provides various services to access analytical data from diverse resources. Currently analytics services for only financial or stock data are available. | ||
It mainly showcases [OpenFeign Clients](https://github.com/OpenFeign/feign), [Netflix Hystrix](https://github.com/Netflix/Hystrix) circuit breakers, [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) with Zipkin and [Spring Webflux](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html) clients. | ||
|
||
### Running the Analytics Service | ||
|
||
The **CONFIG_SERVICE_PASSWORD** is a required parameter to run analytics-service as it enables to access analytics-service.yml configuration file from the [config-service](/../config-service/README.md). | ||
The **ANALYTICS_SERVICE_PASSWORD** is the client secret required to access oauth2 token for client id analytics-service. Use the same **ANALYTICS_SERVICE_PASSWORD** configured in [authorization-service](/../authorization-service/README.md). | ||
Optionally **spring.profiles.active** can be passed with value **prod** which enables logback to send all logs to [Elastic Stack](/../elastic-stack/README.md) instead of logging in the console by default. | ||
|
||
$ java -jar analytics-service/build/libs/analytics-service-0.0.1-SNAPSHOT.jar | ||
-DCONFIG_SERVICE_PASSWORD=xxxx | ||
-DANALYTICS_SERVICE_PASSWORD=yyyy | ||
-Dspring.profiles.active=prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 25 additions & 4 deletions
29
analytics-service/src/main/java/com/emprovise/service/api/FinanceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...ervice/sqldbservice/dto/StockDetails.java → ...om/emprovise/service/dto/StockDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ---------------------------------------- | ||
# Gradle Project Properties | ||
# ---------------------------------------- | ||
|
||
info.build.version=${version?:1.0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ spring: | |
username: user | ||
password: ${CONFIG_SERVICE_PASSWORD} | ||
|
||
info.build.version: ${version?:1.0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
authorization-service/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ---------------------------------------- | ||
# Gradle Project Properties | ||
# ---------------------------------------- | ||
|
||
info.build.version=${version?:1.0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,3 @@ spring: | |
fail-fast: true | ||
username: user | ||
password: ${CONFIG_SERVICE_PASSWORD} | ||
|
||
info.build.version: ${version?:1.0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ---------------------------------------- | ||
# Gradle Project Properties | ||
# ---------------------------------------- | ||
|
||
info.build.version=${version?:1.0} |
Oops, something went wrong.