Skip to content

Commit

Permalink
Adding Eureka Service Discovery.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-taman committed Apr 25, 2020
1 parent 74cce89 commit 4cce07d
Show file tree
Hide file tree
Showing 34 changed files with 711 additions and 317 deletions.
16 changes: 15 additions & 1 deletion docker-compose-kafka.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3.7' ## Latest version works with Docker Engine release 18.06.0+

services:
# Start - Core Microservices
## Start - Product service definition
### Instance 1
product:
Expand Down Expand Up @@ -108,7 +109,19 @@ services:
depends_on:
- kafka
## End - Store service definition
# End - Core Microservices

# Start - Cloud Infrastructure
## Start - Eureka Service Discovery definition
eureka:
build: store-cloud-infra/eureka-server
ports:
- "8761:8761"
restart: always
## End - Eureka Service Discovery definition
# End - Cloud Infrastructure

# Start - Data and transport Infrastructure
## Start - mongodb database definition
### $ mongo
mongodb:
Expand Down Expand Up @@ -166,4 +179,5 @@ services:
environment:
- KAFKA_ADVERTISED_HOST_NAME=zookeeper
restart: on-failure
## End - Zookeeper cluster management service
## End - Zookeeper cluster management service
# End - Data and transport Infrastructure
14 changes: 14 additions & 0 deletions docker-compose-partitions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3.7' ## Latest version works with Docker Engine release 18.06.0+

services:
# Start - Core Microservices
## Start - Product service definition
### Instance 1
product:
Expand Down Expand Up @@ -94,7 +95,19 @@ services:
depends_on:
- rabbitmq
## End - Store service definition
# End - Core Microservices

# Start - Cloud Infrastructure
## Start - Eureka Service Discovery definition
eureka:
build: store-cloud-infra/eureka-server
ports:
- "8761:8761"
restart: always
## End - Eureka Service Discovery definition
# End - Cloud Infrastructure

# Start - Data and transport Infrastructure
## Start - mongodb database definition
### $ mongo
mongodb:
Expand Down Expand Up @@ -143,3 +156,4 @@ services:
retries: 10
restart: on-failure
## End - RabbitMQ Messaging service
# End - Data and transport Infrastructure
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3.7' ## Latest version works with Docker Engine release 18.06.0+

services:
# Start - Core Microservices
## Start - Product service definition
product:
build: store-services/product-service
Expand Down Expand Up @@ -42,7 +43,19 @@ services:
depends_on:
- rabbitmq
## End - Store service definition
# End - Core Microservices

# Start - Cloud Infrastructure
## Start - Eureka Service Discovery definition
eureka:
build: store-cloud-infra/eureka-server
ports:
- "8761:8761"
restart: on-failure
## End - Eureka Service Discovery definition
# End - Cloud Infrastructure

# Start - Data and transport Infrastructure
## Start - mongodb database definition
### $ mongo
mongodb:
Expand Down Expand Up @@ -91,3 +104,4 @@ services:
retries: 10
restart: on-failure
## End - RabbitMQ Messaging service
# End - Data and transport Infrastructure
12 changes: 8 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
</properties>

<modules>
<module>store-base/store-build-chassis</module>
<module>store-base/store-cloud-chassis</module>
<module>store-base/store-service-chassis</module>
<module>store-common/store-api</module>
<module>store-common/store-utils</module>
<module>store-services/product-service</module>
<module>store-services/review-service</module>
<module>store-services/recommendation-service</module>
<module>store-services/store-service</module>
<module>store-common/store-api</module>
<module>store-common/store-utils</module>
<module>store-base/store-build-chassis</module>
<module>store-base/store-service-chassis</module>
<module>store-cloud-infra/eureka-server</module>


</modules>
</project>
15 changes: 9 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/env bash
## author: Mohamed Taman
## version: v1.0
echo -e "\nInstalling all Springy store core shared modules"
echo -e "................................................\n"
## version: v4.5
echo -e "\nInstalling all Springy store core shared modules & Parent POMs"
echo -e "...............................................................\n"
echo "1- Installing [Parent Build Chassis] module..."
./mvnw --quiet clean install -pl store-base/store-build-chassis || exit 126
echo -e "Done successfully.\n"
echo "2- Installing shared [Services Utilities] module..."
echo "2- Installing [Parent Cloud Chassis] module..."
./mvnw --quiet clean install -pl store-base/store-cloud-chassis || exit 126
echo -e "Done successfully.\n"
echo "3- Installing shared [Services Utilities] module..."
./mvnw --quiet clean install -pl store-common/store-utils || exit 126
echo -e "Done successfully.\n"
echo "3- Installing shared [Services APIs] module..."
echo "4- Installing shared [Services APIs] module..."
./mvnw --quiet clean install -pl store-common/store-api || exit 126
echo -e "Done successfully.\n"
echo "4- Installing [Services Parent Chassis] module..."
echo "5- Installing [Services Parent Chassis] module..."
./mvnw --quiet clean install -pl store-base/store-service-chassis || exit 126
echo -e "Done successfully.\n"

Expand Down
35 changes: 26 additions & 9 deletions store-base/store-build-chassis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<properties>
<java.version>14</java.version>
<spring.cloud.version>Hoxton.RELEASE</spring.cloud.version>
<spring.cloud.version>Hoxton.SR4</spring.cloud.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Expand All @@ -31,6 +31,7 @@
<maven.failsafe.plugin.version>3.0.0-M4</maven.failsafe.plugin.version>
<maven.plugin.properties.version>1.0.0</maven.plugin.properties.version>
<maven.plugin.version.version>2.7</maven.plugin.version.version>
<maven.plugin.dockerfile.version>1.4.13</maven.plugin.dockerfile.version>
<springfox.swagger.version>3.0.0-SNAPSHOT</springfox.swagger.version>
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>
<org.lombok.version>1.18.12</org.lombok.version>
Expand Down Expand Up @@ -61,28 +62,44 @@
</dependencyManagement>
<!-- General and common dependencies for all services and libraries -->
<dependencies>

<!-- Start - Development dependencies -->
<!-- Start - Developer utilities tools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!-- End - Developer utilities tools -->
<!-- Start - Spring Configs processor -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- End - Spring Configs processor -->
<!-- Start - Spring tool to check the old keys to be migrated to new ones -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
<scope>runtime</scope>
</dependency>
<!-- End - Spring tool to check the old keys to be migrated to new ones -->
<!-- Start - POJO creation made easy -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- End - POJO creation made easy -->
<!-- End - Development dependencies -->

<!-- Start - Typical spring reactive web framework -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<!-- End - Typical spring reactive web framework -->
<!-- Start - Spring tool to check the old keys to be migrated to new ones -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
<scope>runtime</scope>
</dependency>
<!-- End - Spring tool to check the old keys to be migrated to new ones -->
</dependencies>

<build>
Expand Down
Loading

0 comments on commit 4cce07d

Please sign in to comment.