this repo was derived/separated from This one, check it for older commits.
for this project, you'll have to start these apps in the order : eureka server -> customer-service -> billing-service -> gateway.
this is because the billing service needs to query some data from customer service, and both of them need to be registered on eureka.
⭐ have a look on exceptions management and Http codes returning.
👉 Creating Eureka discovery service/micro-service (& dockerizing it)
👉 Creating Customer micro-service (& dockerizing it)
👉 Creating Billing micro-service (& dockerizing it)
👉 Creating GateWay micro-service (& dockerizing it)
The Docker-compose.yaml is configured properly to run all the microservices together, note that microservices CUSTOMER-SERVICE
and BILLING-SERVICE
are not accessible directly, you need either to uncomment port mapping or pass through gateway, ex : http://localhost:8888/CUSTOMER-SERVICE/api/customers
docker-compose up
- running containers :
- eureka on
http://localhost:8761
:
- test billing api on
http://localhost:8888/BILLING-SERVICE/api/invoices
:
if you're working with minikube you may need to pull images locally first example
minikube image pull scoma/spring-ms-tp1_billing-service:v2
after staring the k8s cluster i applied these config files in order to create :
$ kubectl apply -f .\k8s-eureka.yaml
$ kubectl apply -f .\k8s-customer.yaml
$ kubectl apply -f .\k8s-billing.yaml
$ kubectl apply -f .\k8s-gateway.yaml
# => to create
# {
# 1: eureka pod
# 1: gateway pod
# 2: customer pods
# 2: billing pods
# }
I've set
customer
andbilling
pods on an internal network so that access can be done only through thegateway
to get access to the
gateway
service i ran the commandminikube tunnel
, then i had access to eureka published services
- this is a test of GET:/customers list api through the gateway :
https://www.youtube.com/watch?v=tpCIvZ5QSAs
https://www.youtube.com/watch?v=-fzjrCjTZ6o
https://www.youtube.com/watch?v=_f-LS0Z2CTM
https://www.youtube.com/watch?v=fXYlKpI_XNk
https://www.youtube.com/watch?v=XRUf6k6YCzA
end .<