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
+62-46
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,17 @@
7
7
------
8
8
9
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
11
-
-Microservices/wiki). Each of such stage will be a release in its owen, so you can go back and
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 owen, so you can go back and
12
11
forward
13
12
between releases to see the differences and how adding things solve specific problems we face.
14
13
15
14
For example; 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.
16
15
17
-
At 1st stage the **recommendation** and **review** microservices generate local in-memory data and **product composite service** calls the other three services (*product*, *recommendation*, and *review*) statically to generate client aggregate response for a specific product. Therefore, in:
16
+
At 1st stage the **Recommendation** and **Review** microservices generate local in-memory data
17
+
and **Store Service** calls the other three services (*Product*, *Recommendation*, and *Review*) statically to generate client aggregate response for a specific product. Therefore, in:
18
18
19
-
- The second stage I will introduce **database integration**, then in
20
-
- The third stage I will introduce **Dockerization** of our services and **docker-compose**, and in
19
+
- The second stage I will introduce **database integration**, then in (***done***)
20
+
- The third stage I will introduce **Dockerization** of our services and **docker-compose**, and in (***done***)
21
21
- The fourth stage I will introduce **service discovery**, and so on.
22
22
23
23
## Getting started
@@ -33,19 +33,19 @@ The following topics are going to be covered in this 1st stage (other stages top
33
33
- Introducing the microservice landscape.
34
34
- Generating skeleton microservices.
35
35
- Adding RESTful APIs.
36
-
- Adding a **product composite**, **product**, **recommendation**, and **review** microservices.
36
+
- Adding a **Store**, **Product**, **Recommendation**, and **Review** microservices.
37
37
- Adding error handling.
38
38
- Testing the APIs manually.
39
39
- Adding automated tests of microservices in isolation.
40
40
- Adding semi-automated tests to a microservice landscape.
41
41
42
-
### System Boundary - μServices Landscape
42
+
### System Boundary - μServices Landscape (Release 3)
The following software pieces are initially required:
48
+
The following are the initially required software pieces:
49
49
50
50
1.**Git**: it can be downloaded and installed from https://git-scm.com/downloads.
51
51
@@ -57,6 +57,8 @@ The following software pieces are initially required:
57
57
58
58
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/.
59
59
60
+
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)
61
+
60
62
> For each future stage, I will list the newly required software.
61
63
62
64
Follow the installation guide for each software website and check your software versions from the command line to verify that they are installed correctly.
@@ -85,7 +87,9 @@ To build and run test cases for each service & shared modules in the project we
85
87
86
88
> This done only for the first time or any new version of shared modules.
87
89
88
-
To build and install `store-utils`, `store-api`, `store-chassis` libraries, from the root folder `springy-store-microservices` run the following commands:
90
+
To build and install `store-build-chassis`, `store-utils`, `store-api`, `store-chassis` libraries
91
+
, from the root
92
+
folder `springy-store-microservices` run the following commands:
All the **services** and **databases** will run in parallel in detached mode (option `-d`), and their output will be printed to the console as the following:
167
+
168
+
```bash
169
+
Creating network "ssm_default" with the default driver
170
+
Creating ssm_mysql_1 ... done
171
+
Creating ssm_mongodb_1 ... done
172
+
Creating ssm_store_1 ... done
173
+
Creating ssm_review_1 ... done
174
+
Creating ssm_product_1 ... done
175
+
Creating ssm_recommendation_1 ... done
160
176
```
161
177
162
-
All the services will run in parallel, and their output will be printed to the console.
178
+
### Access Store APIs
179
+
You can manually test `Store Service` APIs through out its **Swagger** interface at the following
Test OK (HTTP Code: 404, {"httpStatus":"NOT_FOUND","message":"No product found for productId: 13","path":"/store/api/v1/products/13","time":"2020-04-12@12:34:25.144+0000"})
186
208
Test OK (HTTP Code: 200)
187
209
Test OK (actual value: 113)
188
210
Test OK (actual value: 0)
@@ -191,12 +213,11 @@ Test OK (HTTP Code: 200)
191
213
Test OK (actual value: 213)
192
214
Test OK (actual value: 3)
193
215
Test OK (actual value: 0)
194
-
Test OK (HTTP Code: 422, {"httpStatus":"UNPROCESSABLE_ENTITY","message":"Invalid productId: -1
Test OK (HTTP Code: 422, {"httpStatus":"UNPROCESSABLE_ENTITY","message":"Invalid productId: -1","path":"/store/api/v1/products/-1","time":"2020-04-12@12:34:26.243+0000"})
196
217
Test OK (actual value: "Invalid productId: -1")
197
-
Test OK (HTTP Code: 400, {"timestamp":"2020-04-01T12:51:49.965+0000","path":"/v1/product-composite
Test OK (HTTP Code: 400, {"timestamp":"2020-04-12T12:34:26.471+00:00","path":"/store/api/v1/products/invalidProductId","status":400,"error":"Bad Request","message":"Type mismatch.","requestId":"044dcdf2-13"})
199
219
Test OK (actual value: "Type mismatch.")
220
+
End: Sun, Apr 12, 2020 2:34:26 PM
200
221
```
201
222
202
223
### Closing The Story
@@ -206,30 +227,25 @@ Finally, to close the story, we will need to shut down Microservices manually se
Copy file name to clipboardExpand all lines: product-composite-service/src/main/java/com/siriusxi/ms/store/pcs/controller/ProductCompositeServiceImpl.java
0 commit comments