An example app using spring cloud and mongo-db to show how one could start to build an online flight booking API.
The following required services need to be started up
- Zipkin:
- Using Docker:
docker run -p 9411:9411 openzipkin/zipkin
- Directly:
curl -sSL https://zipkin.io/quickstart.sh | bash -s java -jar zipkin.jar
- Using Docker:
- RabbitMQ
docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.10-management
- Download and install from https://www.rabbitmq.com/download.html
- Prometheus
- In the prometheus directory:
docker run -p 9090:9090 -v <full-path>\cloud-flights\prometheus\prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
- In the prometheus directory:
To get the solution running, the different microservices need to be fired up in this order:
- Eureka Server
- Config Server
- Cost service
- Flight service
- Booking service
- Cloud Gateway
Each of these can be started up by running mvn spring-boot:run
in the appropriate directory
- Eureka dashboard: http://localhost:8761/
- Hystrix stream: http://localhost:8201/hystrix.stream
- Hystrix turbine dashboard: http://localhost:9090/hystrix/monitor?stream=http://localhost:9090/turbine.stream
POST http://localhost:8201/flights/
{
"id":"1",
"flightDate":"2019-01-01",
"origin":"JOHANNESBURG",
"destination":"CAPE_TOWN",
"seatsAvailable":"20"
}