Data Enrichment With Foreign Exchange Rates

Having an international business means dealing with different foreign exchange rates. This stream uses an internal API, and shows you how to enrich your data by converting different currencies to US Dollars (USD). You can easily change the example to use an external API of your choice.

Functions used in this stream and their purpose:

  • Count - Counter that triggers the stream to run for the defined number of times.

  • Simulate Data (Script) - Provides sample data based on input values from the Count function.

  • Exchange Rate (HTTP Client) - Fetches exchange rates from an internal API.

  • Convert Fees (Map) - Calculate the service fee in USD, and generate and organize records accordingly to business purposes.

  • Log - Saves the result to a log file. Replacing the log with a proper forwarder function, the data could be used for billing purposes.