The Docker compose orchestrate the deployment of customer-api-server, customer-management, mongoDB, Kafka and Zookeeper.
- Docker
- Docker-compose
To install the Stack run the command:
$ docker-compose up -dRun the docker Compose on your VM/laptop
docker-compose up -d
Navigate to http://localhost:9000
To purchase:
curl -X POST http://localhost:5000/api/v1/buy -H 'Content-Type: application/json' -d '{"username":"foo","userId":"1","price":"999"}'
To get all the purchases:
curl http://127.0.0.1:5000/api/v1/getBuyList
The following table lists the configurable parameters of each service.
| Parameter | Description | Default |
|---|---|---|
PORT |
Bootsrap port of the server |
9000 |
CUSTOMER_API_URL |
customer api servcice url |
http://localhost:5000 |
| Parameter | Description | Default |
|---|---|---|
KAFKA_ENDPOINT |
Kafka bus endpoint |
localhost:9093 |
KAFKA_TOPIC |
kafka topic to produce |
buy |
MANAGEMENT_ENDPOINT |
customer-management service endpoint |
http://127.0.0.1:5005 |
SERVER_PORT |
Server port to run the service |
5000 |
| Parameter | Description | Default |
|---|---|---|
KAFKA_ENDPOINT |
Kafka bus endpoint |
localhost:9093 |
KAFKA_TOPIC |
kafka topic to consume |
buy |
KAFKA_GROUP_ID |
Kafka group id |
my-group |
SERVER_PORT |
Server port to run the service |
5005 |
MONGODB_ENDPOINT |
Mongodb endpoint |
localhost:27017 |
MONGODB_DB |
Server port to run the service |
shop |
To purchase:
curl -X POST http://localhost:5000/api/v1/buy -H 'Content-Type: application/json' -d '{"username":"foo","userId":"1","price":"999"}'
To get all the purchases:
curl http://127.0.0.1:5000/api/v1/getBuyList