Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1.1 KB

Readme.md

File metadata and controls

28 lines (23 loc) · 1.1 KB

Micronaut example

Simple micro-service that queries and caches an exchange rate API to convert an amount to a currency

example request:

curl -v -X POST localhost:8080/api/convert \
    -d '{"fromCurrency" : "EUR", "toCurrency" : "USD", "amount": 1600 }' 
    -H 'Content-Type: application/json' | jq

Tech used:

  • Kotlin
  • Micronaut with Non-blocking API(s)
  • Caffeine cache through Micronaut
  • Spock for testing

Caveats:

  • Global error handling did not work really well with reactive types (no way to catch exception inside reactive stream and return custom status code)

Useful links: