Menu

Building a Currency Converter in Spring Boot with Feign and NBP API - Finovara
🖼️

Building a Currency Converter in Spring Boot with Feign and NBP API - Finovara

DEV Community·Marcin Parśniak·6 months ago
#RKimne5j
#programming#api#java#opensource#bigdecimal
Reading 0:00
15s threshold

Recently I added a new backend feature to Finovara — a currency conversion module powered by the public API from the National Bank of Poland (NBP).

The goal was to create a clean and scalable solution that could:

fetch real exchange rates

support multiple conversion strategies

handle external API failures properly

provide precise financial calculations

This feature became a really solid example of practical backend development with Spring Boot and OpenFeign.

Using Feign to Integrate the NBP API.

To communicate with the NBP API, I used OpenFeign.

The implementation is very clean and keeps the HTTP layer separated from the business logic.

@FeignClient ( name = "nbp-api" , url = "${nbp.api.url}" ) public interface NbpApiClient {

@GetMapping ( "/exchangerates/tables/A" ) List < NbpTableDto > getAllRates ( @RequestParam ( "format" ) String format ); }

Enter fullscreen mode

Exit fullscreen mode

NBP provides public exchange rate tables in JSON format, which makes integration very straightforward.

DTO…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.