Visit the Tanzu Developer Center for a detailed walkthrough of the usage of this pattern.
- Start Docker Engine (if necessary)
- Clone this repository and
cd
into the repository folder - Open a new terminal and execute:
docker-compose up account-service
- Open a new terminal and launch the
audit-service
:SERVER_PORT=8888 ./gradlew :audit-service:bootRun
- 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
- 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:The response to this request should becurl --verbose --location --request POST 'localhost:8889/purchase' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 10000 }'
200 OK
. - Observe the output from the
audit-service
. The service console should output:{type=DEBIT, status=SUCCESS, amount=10000} {type=TRANSACTION, status=SUCCESS, amount=10000}