Companies older than five- to ten-years-old lose time and money when replacing legacy services in their IT infrastructures. Often, they are connected to other IT systems in unexpected ways through legacy integration services. Legacy integrations impose a number of risks if they run undocumented, untested or unmonitored in production. Furthermore, existing and upcoming privacy regulations create a need to manage their logs and connected data stores transparently.
In an offer calculation pipeline, use Xapix to replace a legacy currency rate service. Create a version switch in the pipeline to learn about the decision unit and its frequent companion, the merge unit. Create a transform unit to adapt your new currency rate service response to the legacy service’s output format.
On your onboarding exercise project’s home screen
click on the endpoint
select Edit Pipeline to get to your offer calculations pipeline dashboard.
In the pipeline, click on the Decision unit and add a new branch by clicking the new branch symbol in the upper right corner of the screen.
Enter a telling name, e.g. “new-api-v2”, and copy the formula from the v1 branch
Change the conditional to “v2”.
Click Save and then Done to return to the pipeline dashboard.
Back in the pipeline, click Add Unit on the upper left corner. In the overlay dialogue, add the "exchangeratesapi.io latest" Connector unit to the pipeline.
Then, click Add Unit again and this time add a Transform unit to the pipeline.
Now, back on the pipeline dashboard
connect your v2 branch of the Decision unit with the "exchangeratesapi.io" Connector unit
connect the "exchangeratesapi.io" Connector unit with your new Transform unit and the Transform unit with the Merge unit.
Click on the Transform unit and mimic the legacy connector’s response format.
Add a new property "body" of type object.
Add two attributes named "EUR_USD" and "api_version", both of type “literal”.
On the left side of the screen, showing the response body from the "exchangeratesapi.io" Connector, scroll down to the attribute "USD" nested in the rates object and drag and drop it over to your new property "EUR_USD".
For the "api_version" property enter a fixed string, such as “exchangerates_io 2020”.
Use the Publish button to deploy your project.
Finally, test whether the response matches your expectations by copying the cURL command in the bottom right corner into a new terminal window on your computer.