You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-62Lines changed: 50 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,20 @@
1
1
# Springy Store μServices
2
2
3
-
- This project is a development of a small set of **Spring Boot** and **Cloud** based Microservices projects, that implement cloud-native intuitive, Reactive Programming, Event-driven, Microservices design patterns and coding best practices.
4
-
- The project follows [**CloudNative**](https://www.cncf.io/) recommendations and The [**twelve-factor app**](https://12factor.net/) methodology for building *software-as-a-service apps* to show how μServices should be built and deployed.
3
+
- This project is a development of a small set of **Spring Boot** and **Cloud** based Microservices projects that implement cloud-native intuitive, Reactive Programming, Event-driven, Microservices design patterns, and coding best practices.
4
+
- The project follows [**CloudNative**](https://www.cncf.io/) recommendations and The [**twelve-factor app**](https://12factor.net/) methodology for building *software-as-a-service apps* to show how μServices should be developed and deployed.
5
5
- This project uses cutting edge technologies like Docker, Kubernetes, Elasticsearch Stack for
6
6
logging and monitoring, Java SE 14, MySQL, and MongoDB databases, all components developed with TDD in mind, covering integration & performance testing, and many more.
7
7
8
8
------
9
-
I am developing this project as stages, and all such stages are documented under project
10
-
**Springy Store μServices**[wiki page](https://github.com/mohamed-taman/Springy-Store-Microservices/wiki). Each of such stage will be a release in its own, so you can go back and
11
-
forward between releases to see the differences and how adding things solve specific problems we face.
9
+
I am developing this project as stages, and all such steps are documented under the project **Springy Store μServices**[wiki page](https://github.com/mohamed-taman/Springy-Store-Microservices/wiki). Each such stage will be a release in its own, so you can go back and forward between versions to see the differences and how adding things solve specific problems we face.
12
10
13
-
<u>For example;</u> in the first stage (1st release) I just created project structure, basic services' skeleton, integration between them, and finally write integration testing as well as semi-automated testing for the whole services' functionality.
11
+
<u>For example, </u> in the first stage (1st release), I just created project structure, essential services' skeleton, integration between them, and finally write integration testing as well as semi-automated testing for the complete services' functionality.
14
12
15
-
At the 1st stage the **Recommendation** and **Review** microservices generate local in-memory data and **Store Service** calls the other three services (*Product*, *Recommendation*, and *Review*) statically to generate client aggregate response for a specific product. Therefore, in:
13
+
At the 1st stage, the **Recommendation** and **Review** microservices generate local in-memory data, and **Store Service** calls the other three services (*Product*, *Recommendation*, and *Review*) statically to generate client aggregate response for a specific product. Therefore, in:
16
14
17
15
- The second stage I will introduce **database integration**, then in (***done***)
18
-
- The third stage I will introduce**Dockerization** of our services and **docker-compose**, and in (***done***)
19
-
-The fourth stage I will introduce **service discovery**, and so on.
16
+
- The third stage I will add**Dockerization** of our services and **docker-compose**, and in (***done***)
17
+
-In the fourth stage, I will introduce **service discovery**, and so on.
20
18
21
19
## System components Structure
22
20
Let's explain first the system structure to understand its components:
@@ -48,17 +46,15 @@ Springy Store μService --> Parent folder.
48
46
|- stop-em-all.sh --> Stop all services runs in standalone mode.
49
47
|- test-em-all.sh --> This will start all docker compose landscape and test them, then shutdown docker compose containers with test finishes (use switch start stop)
50
48
```
51
-
Now as we have learned about different system components, then let's start.
49
+
Now, as we have learned about different system components, then let's start.
52
50
53
51
## Getting started
54
52
55
-
The first stage aka (**Release v1.0**) is about creating and implementing a set of project Microservices.
53
+
The first stage, aka (**Release v1.0**), is about creating and implementing a set of project Microservices.
56
54
57
55
### Creating a Set of Cooperating Microservices (Release v1.0)
58
56
59
-
The following topics are going to be covered in this 1st stage (other stages topics to be documented
60
-
in a
61
-
project wiki):
57
+
The following topics are going to be covered in this 1st stage (other stages topics will be documented in the project wiki pages):
62
58
63
59
- Introducing the microservice landscape.
64
60
- Generating skeleton microservices.
@@ -85,33 +81,33 @@ The following are the initially required software pieces:
85
81
86
82
4.**jq**: This command-line JSON processor can be downloaded and installed from https://stedolan.github.io/jq/download/.
87
83
88
-
5. Spring Boot Initializer: This *Initializer* generates *spring* boot project with just what you need to start quickly! start from here https://start.spring.io/.
84
+
5. Spring Boot Initializer: This *Initializer* generates *spring* boot project with just what you need to start quickly! Start from here https://start.spring.io/.
89
85
90
86
6.**Docker Desktop**: The fastest way to containerize applications on your desktop, and you can download it from here [https://www.docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop)
91
87
92
88
> For each future stage, I will list the newly required software.
93
89
94
-
Follow the installation guide for each software website and check your software versions from the command line to verify that they are installed correctly.
90
+
Follow the installation guide for each software website link and check your software versions from the command line to verify that they are all installed correctly.
95
91
96
92
## Using an IDE
97
93
98
-
I recommend that you work with your Java code using an IDE that supports the development of Spring Boot applications such as Spring Tool Suite or IntelliJ IDEA Ultimate Edition. So you can use the Spring Boot Dashboard to run the services, run each microservice test case and many more.
94
+
I recommend that you work with your Java code using an IDE that supports the development of Spring Boot applications such as Spring Tool Suite or IntelliJ IDEA Ultimate Edition. So you can use the Spring Boot Dashboard to run the services, run each microservice test case, and many more.
99
95
100
-
All that you want to do is just fire up your IDE **->** open or import the parent folder `springy-store-microservices` and everything will be ready for you.
96
+
All that you want to do is just fire up your IDE **->** open or import the parent folder `springy-store-microservices,` and everything will be ready for you.
101
97
102
98
## Playing With Springy Store Project
103
99
104
100
### Cloning It
105
101
106
-
First open **git bash** command line, then simply you can clone the project under any of your favorite places as the following:
102
+
The first thing to do is to open **git bash** command line, and then simply you can clone the project under any of your favorite places as the following:
If you would like to access the Eureka service discovery point to this URL [http://localhosts:8443/eureka/web](https://localhost:8443/eureka/web) to see all the services registered inside it.
217
+
218
+
Note that it is accessed through API Gateway and is secured. Therefore the browser will ask you for `username:mt` and `password:p,` write them to the dialog, and you will access it. This type of security is a **basic form security**.
219
+
220
+
The **API Gateway** and **Store Service** both act as a *resource server*. To know more about calling Store API in a secure way you can check the `test-em-all.sh` script on how I have changed the calling of the services using **OAuth2** security.
221
+
222
+
### Access RabbitMQ
221
223
In browser point to this URL [http://localhost:5672/](http://localhost:5672/)`username: guest` and `password: guest`, and you can see all **topics**, **DLQs**, **partitions**, and payload.
222
224
223
-
1. For running 2 instances of each service and using _RabbitMQ with two partitions per topic_, use the following `docker-compose` command:
225
+
1. For running two instances of each service and using _RabbitMQ with two partitions per topic_, use the following `docker-compose` command:
Starting 'Springy Store μServices' for [Blackbox] testing....
277
+
Starting 'Springy Store μServices' for [Blackbox] testing...
287
278
288
279
Start Tests: Fri, May 8, 2020 12:26:28 PM
289
280
HOST=localhost
@@ -317,17 +308,14 @@ Test OK (HTTP Code: 200)
317
308
Test OK (HTTP Code: 403, )
318
309
End, all tests OK: Fri, May 8, 2020 12:29:21 PM
319
310
```
320
-
321
311
### Closing The Story
322
312
323
-
Finally, to close the story, we need to shut down Microservices manually service by service
324
-
, hahaha just kidding, run the following command to shut them all:
313
+
Finally, to close the story, we need to shut down Microservices manually service by service, hahaha just kidding, run the following command to shut them all:
Copy file name to clipboardExpand all lines: store-common/store-utils/src/main/java/com/siriusxi/ms/store/util/http/GlobalControllerExceptionHandler.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,8 @@
17
17
* The class Global controller exception handler is a generic and central point for all
18
18
* microservices that handles all services exceptions.
19
19
*
20
-
* It act as filter so it is pluggable component just added to microservice context automatically,
21
-
* when you add <code>ComponentScan</code> on your application.
20
+
* <p>It act as filter so it is pluggable component just added to microservice context
21
+
* automatically, when you add <code>ComponentScan</code> on your application.
0 commit comments