See what makes Kong the fastest, most-adopted API gateway
Check out the latest Kong feature releases and updates
Single platform for SaaS end-to-end connectivity
Enterprise service mesh based on Kuma and Envoy
Collaborative API design platform
API and Microservices Security for Gateways, Service Mesh, and Beyond
Call for speakers & sponsors, Kong API Summit 2023!
4 MIN READ
Creating an API contract and corresponding Kong service are often just the first steps in the API development process. More often than not, the upstream services that are invoked provide a different contract to the one presented to the API consumer. This is especially the case in larger organizations where enterprise applications offer their own out-of-the-box integration contracts. Likewise, you shouldn’t expose the complexity of your upstream systems to your API consumer. So, what’s the best way to transform these upstream/downstream requests into something that both sides can understand?
Enter Reedelk, a Kong Hub plugin partner, which provides a platform to develop API data integrations and transformations with a visual designer based on IntelliJ IDEA. Reedelk helps you boost your development productivity by providing pre-built components packaged in modules to get you up and running quickly. By simply dragging and dropping components onto the canvas, you can save a lot of time in comparison to writing code from scratch. Being component-oriented also improves the quality of your implementation due to reusability. There’s also the option of importing your OpenAPI Specification that you designed in Insomnia into Reedelk; this saves you time when building a new API or integration flow.
There are several components available, allowing you to work with different technologies and performing transformations, such as JSON, XML, MongoDB, Google Drive and RDBMS components. There’s the option to develop your own custom components for more ad-hoc requirements.
Running your integration flow alongside Kong is simple – either use a pre-built Reedelk Docker image or create your own. The Reedelk runtime is by design lightweight to meet the need for agile deployments and microservice oriented architectures. Administration is taken care of with a purpose-built console that shows you what you have deployed and where.
The Reedelk Transformer Plugin can be applied in the Kong upstream phase to transform data before invoking the upstream service or in the downstream phase to transform data returned by the upstream service before returning it to the API user.
The following figure shows the high-level architecture of the Reedelk Transformer plugin for Kong when configured in the downstream phase:
Fig 1: Kong Reedelk Transformer plugin high-level architecture – downstream phase
In the following example, a mobile banking application may need to display different information depending on whether the customer is a private person or a business account. Within the associated OpenAPI Specification, a discriminator is used to handle the various fields accordingly. To resolve this use case with Reedelk, we simply create a new flow, which transforms an incoming request from one JSON structure to another JSON structure according to the value of a JSON property named “customerType.”
The Router Component in the flow checks the value of the “customerType” property from the original JSON payload coming from the upstream service: if its value is ‘business’ the JSON is transformed in one structure, if its value is ‘private’ the JSON is transformed in a different structure with only a subset of the original properties.
Fig 2: Reedelk Flow Designer displaying an integration flow to transform a JSON structure into another JSON structure based on a condition.
Once the Reedelk Transformer plugin for Kong is installed and properly configured, no additional configuration is required in order to integrate Reedelk with Kong and have Reedelk transform the payload passing through the Kong API gateway.
Allan is the co-founder of Reedelk together with his business partner Lorenzo. Allan spent the last twenty years working for large enterprises but now works on his integration platform Reedelk. He lives in Helsinki, the birthplace of Nokia, and is surrounded by many wonderful people. Allan is now working really hard to put his knowledge and passion to good use; please feel free to get in touch with him.
Ready to Transform Your Requests/Responses?
Check Out the Kong Reedelk Transformer Plugin