Skip to content

About

Kotlin/Spring Boot service returning account balances converted to USD via the NBP exchange-rate API, with retries and caching.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

currency-account-service

Example service with in-memory users accounts with PLN balance. API endpoint returns account by user's id with USD balance converted by external exchange rate service. Authentication and authorization is handle on another layer.

Running locally

./gradlew bootRun

The service then listens on http://localhost:8080, for example: http://localhost:8080/api/v1/accounts/1

PLN to USD Conversion

Service uses NBP API to get exchange rate. To ensure more stability and efficiency, following features are implemented:

  • Retries when NBP return 5xx status code.
  • Cache on getting exchange rate, because NBP refresh data every new day.

Swagger

API docs are served by the running application at http://localhost:8080/swagger. Account response fields are described there in the schema section of account-controller/getAccount.

To do

Things to implement in the future:

  • Circuit-breaker pattern (instead of retries)
  • Better requests debug logs format

About

Kotlin/Spring Boot service returning account balances converted to USD via the NBP exchange-rate API, with retries and caching.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages