Skip to content

Commit 4cce07d

Browse files
committed
Adding Eureka Service Discovery.
1 parent 74cce89 commit 4cce07d

File tree

34 files changed

+711
-317
lines changed

34 files changed

+711
-317
lines changed

docker-compose-kafka.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: '3.7' ## Latest version works with Docker Engine release 18.06.0+
22

33
services:
4+
# Start - Core Microservices
45
## Start - Product service definition
56
### Instance 1
67
product:
@@ -108,7 +109,19 @@ services:
108109
depends_on:
109110
- kafka
110111
## End - Store service definition
112+
# End - Core Microservices
111113

114+
# Start - Cloud Infrastructure
115+
## Start - Eureka Service Discovery definition
116+
eureka:
117+
build: store-cloud-infra/eureka-server
118+
ports:
119+
- "8761:8761"
120+
restart: always
121+
## End - Eureka Service Discovery definition
122+
# End - Cloud Infrastructure
123+
124+
# Start - Data and transport Infrastructure
112125
## Start - mongodb database definition
113126
### $ mongo
114127
mongodb:
@@ -166,4 +179,5 @@ services:
166179
environment:
167180
- KAFKA_ADVERTISED_HOST_NAME=zookeeper
168181
restart: on-failure
169-
## End - Zookeeper cluster management service
182+
## End - Zookeeper cluster management service
183+
# End - Data and transport Infrastructure

docker-compose-partitions.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: '3.7' ## Latest version works with Docker Engine release 18.06.0+
22

33
services:
4+
# Start - Core Microservices
45
## Start - Product service definition
56
### Instance 1
67
product:
@@ -94,7 +95,19 @@ services:
9495
depends_on:
9596
- rabbitmq
9697
## End - Store service definition
98+
# End - Core Microservices
9799

100+
# Start - Cloud Infrastructure
101+
## Start - Eureka Service Discovery definition
102+
eureka:
103+
build: store-cloud-infra/eureka-server
104+
ports:
105+
- "8761:8761"
106+
restart: always
107+
## End - Eureka Service Discovery definition
108+
# End - Cloud Infrastructure
109+
110+
# Start - Data and transport Infrastructure
98111
## Start - mongodb database definition
99112
### $ mongo
100113
mongodb:
@@ -143,3 +156,4 @@ services:
143156
retries: 10
144157
restart: on-failure
145158
## End - RabbitMQ Messaging service
159+
# End - Data and transport Infrastructure

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: '3.7' ## Latest version works with Docker Engine release 18.06.0+
22

33
services:
4+
# Start - Core Microservices
45
## Start - Product service definition
56
product:
67
build: store-services/product-service
@@ -42,7 +43,19 @@ services:
4243
depends_on:
4344
- rabbitmq
4445
## End - Store service definition
46+
# End - Core Microservices
4547

48+
# Start - Cloud Infrastructure
49+
## Start - Eureka Service Discovery definition
50+
eureka:
51+
build: store-cloud-infra/eureka-server
52+
ports:
53+
- "8761:8761"
54+
restart: on-failure
55+
## End - Eureka Service Discovery definition
56+
# End - Cloud Infrastructure
57+
58+
# Start - Data and transport Infrastructure
4659
## Start - mongodb database definition
4760
### $ mongo
4861
mongodb:
@@ -91,3 +104,4 @@ services:
91104
retries: 10
92105
restart: on-failure
93106
## End - RabbitMQ Messaging service
107+
# End - Data and transport Infrastructure

pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@
1717
</properties>
1818

1919
<modules>
20+
<module>store-base/store-build-chassis</module>
21+
<module>store-base/store-cloud-chassis</module>
22+
<module>store-base/store-service-chassis</module>
23+
<module>store-common/store-api</module>
24+
<module>store-common/store-utils</module>
2025
<module>store-services/product-service</module>
2126
<module>store-services/review-service</module>
2227
<module>store-services/recommendation-service</module>
2328
<module>store-services/store-service</module>
24-
<module>store-common/store-api</module>
25-
<module>store-common/store-utils</module>
26-
<module>store-base/store-build-chassis</module>
27-
<module>store-base/store-service-chassis</module>
29+
<module>store-cloud-infra/eureka-server</module>
30+
31+
2832
</modules>
2933
</project>

setup.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
#!/usr/bin/env bash
22
## author: Mohamed Taman
3-
## version: v1.0
4-
echo -e "\nInstalling all Springy store core shared modules"
5-
echo -e "................................................\n"
3+
## version: v4.5
4+
echo -e "\nInstalling all Springy store core shared modules & Parent POMs"
5+
echo -e "...............................................................\n"
66
echo "1- Installing [Parent Build Chassis] module..."
77
./mvnw --quiet clean install -pl store-base/store-build-chassis || exit 126
88
echo -e "Done successfully.\n"
9-
echo "2- Installing shared [Services Utilities] module..."
9+
echo "2- Installing [Parent Cloud Chassis] module..."
10+
./mvnw --quiet clean install -pl store-base/store-cloud-chassis || exit 126
11+
echo -e "Done successfully.\n"
12+
echo "3- Installing shared [Services Utilities] module..."
1013
./mvnw --quiet clean install -pl store-common/store-utils || exit 126
1114
echo -e "Done successfully.\n"
12-
echo "3- Installing shared [Services APIs] module..."
15+
echo "4- Installing shared [Services APIs] module..."
1316
./mvnw --quiet clean install -pl store-common/store-api || exit 126
1417
echo -e "Done successfully.\n"
15-
echo "4- Installing [Services Parent Chassis] module..."
18+
echo "5- Installing [Services Parent Chassis] module..."
1619
./mvnw --quiet clean install -pl store-base/store-service-chassis || exit 126
1720
echo -e "Done successfully.\n"
1821

store-base/store-build-chassis/pom.xml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<properties>
2121
<java.version>14</java.version>
22-
<spring.cloud.version>Hoxton.RELEASE</spring.cloud.version>
22+
<spring.cloud.version>Hoxton.SR4</spring.cloud.version>
2323
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2424
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2525

@@ -31,6 +31,7 @@
3131
<maven.failsafe.plugin.version>3.0.0-M4</maven.failsafe.plugin.version>
3232
<maven.plugin.properties.version>1.0.0</maven.plugin.properties.version>
3333
<maven.plugin.version.version>2.7</maven.plugin.version.version>
34+
<maven.plugin.dockerfile.version>1.4.13</maven.plugin.dockerfile.version>
3435
<springfox.swagger.version>3.0.0-SNAPSHOT</springfox.swagger.version>
3536
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>
3637
<org.lombok.version>1.18.12</org.lombok.version>
@@ -61,28 +62,44 @@
6162
</dependencyManagement>
6263
<!-- General and common dependencies for all services and libraries -->
6364
<dependencies>
64-
65+
<!-- Start - Development dependencies -->
66+
<!-- Start - Developer utilities tools -->
67+
<dependency>
68+
<groupId>org.springframework.boot</groupId>
69+
<artifactId>spring-boot-devtools</artifactId>
70+
<scope>runtime</scope>
71+
<optional>true</optional>
72+
</dependency>
73+
<!-- End - Developer utilities tools -->
74+
<!-- Start - Spring Configs processor -->
75+
<dependency>
76+
<groupId>org.springframework.boot</groupId>
77+
<artifactId>spring-boot-configuration-processor</artifactId>
78+
<optional>true</optional>
79+
</dependency>
80+
<!-- End - Spring Configs processor -->
81+
<!-- Start - Spring tool to check the old keys to be migrated to new ones -->
82+
<dependency>
83+
<groupId>org.springframework.boot</groupId>
84+
<artifactId>spring-boot-properties-migrator</artifactId>
85+
<scope>runtime</scope>
86+
</dependency>
87+
<!-- End - Spring tool to check the old keys to be migrated to new ones -->
6588
<!-- Start - POJO creation made easy -->
6689
<dependency>
6790
<groupId>org.projectlombok</groupId>
6891
<artifactId>lombok</artifactId>
6992
<optional>true</optional>
7093
</dependency>
7194
<!-- End - POJO creation made easy -->
95+
<!-- End - Development dependencies -->
7296

7397
<!-- Start - Typical spring reactive web framework -->
7498
<dependency>
7599
<groupId>org.springframework.boot</groupId>
76100
<artifactId>spring-boot-starter-webflux</artifactId>
77101
</dependency>
78102
<!-- End - Typical spring reactive web framework -->
79-
<!-- Start - Spring tool to check the old keys to be migrated to new ones -->
80-
<dependency>
81-
<groupId>org.springframework.boot</groupId>
82-
<artifactId>spring-boot-properties-migrator</artifactId>
83-
<scope>runtime</scope>
84-
</dependency>
85-
<!-- End - Spring tool to check the old keys to be migrated to new ones -->
86103
</dependencies>
87104

88105
<build>

0 commit comments

Comments
 (0)