Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Build Status](https://travis-ci.org/AITestingOrg/banking-microservices-tutorial.svg?branch=master)](https://travis-ci.org/AITestingOrg/banking-microservices-tutorial)
[![Coverage Status](https://coveralls.io/repos/github/AITestingOrg/banking-microservices-tutorial/badge.svg?branch=service-integration-testing)](https://coveralls.io/github/AITestingOrg/banking-microservices-tutorial?branch=service-integration-testing)

The Banking Microservices Example project is a small system used to show how microservices can be implemented and tested with Micronaut, Consul, Tyk, and Axon's Event Sourcing framework. The system can be run in multiple configurations using Docker.
The Banking Microservices Tutorial project is a small system used to show how microservices can be implemented and tested with Micronaut, Consul, Tyk, and Axon's Event Sourcing framework. The system can be run in multiple configurations using Docker.

![](documentation/images/micronaut.jpg)![](documentation/images/axon.png)![](documentation/images/consul.svg)![](documentation/images/mongo.png)![](documentation/images/express-gateway.png)![](documentation/images/junit5-banner.png)
## Architecture
Expand All @@ -29,6 +29,9 @@ See each services readme for detailed requirement information
### Java 8
* https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

### IntelliJ IDEA
* The recommended IDE for this project https://www.jetbrains.com/idea/, Community Edition is fine.

### Lombok
* IntelliJ IDEA installation: https://projectlombok.org/setup/intellij

Expand All @@ -40,16 +43,20 @@ See each services readme for detailed requirement information
# Assemble the binaries
./gradlew assemble
# Start the backing services: service discovery, configuration, authentication, edge service
docker-compose -f docker-compose-backing.yml up --build
# After the backing services have succesfully loaded, start the domain services
docker-compose up
docker-compose up --build
```

## Stop the Containers
```bash
docker-compose down
docker-compose -f docker-compose.yml down
docker-compose -f docker-compose-backing.yml down
```

## Running with Mocks
To download the Mock images and test running on your machine use the following commands.
```bash
docker-compose -f docker-compose-sub-domain-testing.yml up
# After verifying everything spun up correctly tear it down.
docker-compose -f docker-compose-sub-domain-testing.yml down

```

Expand Down Expand Up @@ -175,6 +182,7 @@ sh ./scripts/run-transaction-pairwise-tests-with-cmd.sh
Take down the services in the other terminal window.
```bash
docker-compose -f docker-compose-pair-wise-account-cmd-transaction.yml down
```

# API Documentation:

Expand Down
73 changes: 0 additions & 73 deletions docker-compose-backing.yml

This file was deleted.

30 changes: 15 additions & 15 deletions docker-compose-sub-domain-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ services:
- ./docker/wiremock/people:/home/wiremock
restart: on-failure

account-cmd:
build: domain-services/account-cmd/
mem_limit: 400m
ports:
- "8082:8082"
restart: on-failure
environment:
- PEOPLE_GATEWAY=people-gateway-mock
- CONSUL_HOST=discovery-service
- MONGO_HOST=mongo
- AXON_HOST=axonserver
- HOST_PORT=8082
depends_on:
- discovery-service
- axonserver
# account-cmd:
# build: domain-services/account-cmd/
# mem_limit: 400m
# ports:
# - "8082:8082"
# restart: on-failure
# environment:
# - PEOPLE_GATEWAY=people-gateway-mock
# - CONSUL_HOST=discovery-service
# - MONGO_HOST=mongo
# - AXON_HOST=axonserver
# - HOST_PORT=8082
# depends_on:
# - discovery-service
# - axonserver

account-query:
build: domain-services/account-query/
Expand Down
74 changes: 58 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,69 @@
version: '2.1'
services:
discovery-service:
image: bitnami/consul:latest
ports:
- '8300:8300'
- '8301:8301'
- '8301:8301/udp'
- '8500:8500'
- '8600:8600'
- '8600:8600/udp'

people-gateway:
build: docker/express-gateway/
ports:
- "8081:8080"
- "8443:8443"
- "9876:9876"
volumes:
- ./docker/express-gateway/people-configuration/system.config.yml:/usr/src/app/config/system.config.yml
- ./docker/express-gateway/people-configuration/gateway.config.yml:/usr/src/app/config/gateway.config.yml
depends_on:
- redis

account-gateway:
build: docker/express-gateway/
ports:
- "8080:8080"
- "8444:8443"
- "9877:9876"
volumes:
- ./docker/express-gateway/account-configuration/system.config.yml:/usr/src/app/config/system.config.yml
- ./docker/express-gateway/account-configuration/gateway.config.yml:/usr/src/app/config/gateway.config.yml
depends_on:
- redis

mongo:
image: 'mongo:3.4.1'
ports:
- '27017:27017'
volumes:
- 'mongo:/data/mongo/db'

redis:
image: redis
ports:
- "6379:6379"
volumes:
- 'redis:/data/redis'

axonserver:
image: 'axoniq/axonserver'
ports:
- '8124:8124'
- '8024:8024'

people-details:
build: domain-services/people-details/
mem_limit: 400m
ports:
- "8085:8085"
networks:
- banking-microservices-tutorial_bank
restart: on-failure
environment:
- CONSUL_HOST=discovery-service
- MONGO_HOST=mongo
- AXON_HOST=axonserver
- HOST_PORT=8085
- ES_JAVA_OPTS= "-Xms450mb -Xmx450mb"

Expand All @@ -19,12 +72,11 @@ services:
mem_limit: 400m
ports:
- "8087:8087"
networks:
- banking-microservices-tutorial_bank
restart: on-failure
environment:
- CONSUL_HOST=discovery-service
- MONGO_HOST=mongo
- AXON_HOST=axonserver
- HOST_PORT=8087
- ES_JAVA_OPTS= "-Xms450mb -Xmx450mb"

Expand All @@ -33,12 +85,11 @@ services:
mem_limit: 400m
ports:
- "8088:8088"
networks:
- banking-microservices-tutorial_bank
restart: on-failure
environment:
- CONSUL_HOST=discovery-service
- MONGO_HOST=mongo
- AXON_HOST=axonserver
- HOST_PORT=8088
- ES_JAVA_OPTS= "-Xms450mb -Xmx450mb"

Expand All @@ -47,8 +98,6 @@ services:
mem_limit: 400m
ports:
- "8082:8082"
networks:
- banking-microservices-tutorial_bank
restart: on-failure
environment:
- CONSUL_HOST=discovery-service
Expand All @@ -61,8 +110,6 @@ services:
mem_limit: 400m
ports:
- "8084:8084"
networks:
- banking-microservices-tutorial_bank
restart: on-failure
environment:
- CONSUL_HOST=discovery-service
Expand All @@ -83,13 +130,8 @@ services:
- HOST_PORT=8086
- PEOPLE_DETAILS_HOST=
- ES_JAVA_OPTS= "-Xms150mb -Xmx150mb"
networks:
- banking-microservices-tutorial_bank
restart: on-failure

networks:
banking-microservices-tutorial_bank:
external: true

volumes:
redis:
mongo:
Loading