Skip to content

A small example of a Banking application that consists of 3 services that illustrates how to use Docker's special network address feature host.docker.internal to allow communication between a workstation and containerized services on Window and MacOS.

License

Notifications You must be signed in to change notification settings

vmware-tanzu-labs/simple-distributed-bank-services-demo

Repository files navigation

Simple Distributed Bank Services Demo

Simple Distributed Bank Services Demo

Visit the Tanzu Developer Center for a detailed walkthrough of the usage of this pattern.

Quickstart

  1. Start Docker Engine (if necessary)
  2. Clone this repository and cd into the repository folder
  3. Open a new terminal and execute:
    docker-compose up account-service
  4. Open a new terminal and launch the audit-service:
    SERVER_PORT=8888 ./gradlew :audit-service:bootRun
  5. Open a new terminal and launch the debit-service:
    SERVER_PORT=8889 ACCOUNT_SERVICE_URL=http://localhost:48081 AUDIT_SERVICE_URL=http://localhost:8888 ./gradlew :debit-service:bootRun
  6. Use Postman with the Simple Distributed Bank Services Demo => Debit Service => Purchase 8889 request provided in this collection, or, open a new terminal and execute:
    curl --verbose --location --request POST 'localhost:8889/purchase' \
    --header 'Content-Type: application/json' \
    --data-raw '{ "amount": 10000 }'
    The response to this request should be 200 OK.
  7. Observe the output from the audit-service. The service console should output:
    {type=DEBIT, status=SUCCESS, amount=10000}
    {type=TRANSACTION, status=SUCCESS, amount=10000}
    

About

A small example of a Banking application that consists of 3 services that illustrates how to use Docker's special network address feature host.docker.internal to allow communication between a workstation and containerized services on Window and MacOS.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages