Skip to content

Latest commit

 

History

History
30 lines (30 loc) · 1.5 KB

File metadata and controls

30 lines (30 loc) · 1.5 KB

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}