• Explore the unified API Platform
        • BUILD APIs
        • Kong Insomnia
        • API Design
        • API Mocking
        • API Testing & Debugging
        • MCP Client
        • RUN APIs
        • API Gateway
        • Context Mesh
        • AI Gateway
        • Event Gateway
        • Kubernetes Operator
        • Service Mesh
        • Ingress Controller
        • Runtime Management
        • DISCOVER APIs
        • Developer Portal
        • Service Catalog
        • MCP Registry
        • GOVERN APIs
        • Metering & Billing
        • APIOps & Automation
        • API Observability
        • Why Kong?
      • CLOUD
      • Cloud API Gateways
      • Need a self-hosted or hybrid option?
      • COMPARE
      • Considering AI Gateway alternatives?
      • Kong vs. Postman
      • Kong vs. MuleSoft
      • Kong vs. Apigee
      • Kong vs. IBM
      • GET STARTED
      • Sign Up for Kong Konnect
      • Documentation
  • Agents
      • FOR PLATFORM TEAMS
      • Developer Platform
      • Kubernetes & Microservices
      • Observability
      • Service Mesh Connectivity
      • Kafka Event Streaming
      • FOR EXECUTIVES
      • AI Connectivity
      • Open Banking
      • Legacy Migration
      • Platform Cost Reduction
      • Kafka Cost Optimization
      • API Monetization
      • AI Monetization
      • AI FinOps
      • FOR AI TEAMS
      • AI Cost Control
      • AI Governance
      • AI Integration
      • AI Security
      • Agentic Infrastructure
      • MCP Production
      • MCP Traffic Gateway
      • FOR DEVELOPERS
      • Mobile App API Development
      • GenAI App Development
      • API Gateway for Istio
      • Decentralized Load Balancing
      • BY INDUSTRY
      • Financial Services
      • Healthcare
      • Higher Education
      • Insurance
      • Manufacturing
      • Retail
      • Software & Technology
      • Transportation
      • See all Solutions
      • DOCUMENTATION
      • Kong Konnect
      • Kong Gateway
      • Kong Mesh
      • Kong AI Gateway
      • Kong Insomnia
      • Plugin Hub
      • EXPLORE
      • Blog
      • Learning Center
      • eBooks
      • Reports
      • Demos
      • Customer Stories
      • Videos
      • EVENTS
      • AI + API Summit
      • Webinars
      • User Calls
      • Workshops
      • Meetups
      • See All Events
      • FOR DEVELOPERS
      • Get Started
      • Community
      • Certification
      • Training
      • COMPANY
      • About Us
      • Why Kong?
      • We're Hiring!
      • Press Room
      • Investors
      • Contact Us
      • PARTNER
      • Kong Partner Program
      • SECURITY
      • Trust and Compliance
      • SUPPORT
      • Enterprise Support Portal
      • Professional Services
      • Documentation
      • Press Releases

        Kong Names Bruce Felt as Chief Financial Officer

        Read More
  • Pricing
  • Login
  • Get a Demo
  • Start for Free
Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
|
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. Rapid Application Modernization With Kong Konnect and Apache Camel (Part 1)
Engineering
January 6, 2022
5 min read

Rapid Application Modernization With Kong Konnect and Apache Camel (Part 1)

Simon Green

Here's a story about a developer surviving in a world of APIs, Kubernetes and rapid application modernization.

developer-APIs

Meet Josh (a pseudonym). Josh is your typical developer. He's good at writing code in his native language, hates documentation and REALLY hates the "drag and drop" approach to developing software found in bloated API management platforms. Josh would rather write code, weave in some docs and avoid worrying about security, networking, deployment and reliability. Josh avoids venturing into newer networking technologies like Istio, labeling them unnecessarily complicated to configure and maintain. He would rather write everything in Java, Groovy or his go-to integration library: Apache Camel.

Recently Josh stumbled across an open source API platform called Kong. After 30 minutes of playing around, Josh discovered how easy it was to:

  • Support both legacy and modern clients accessing different versions of the same application.
  • Migrate existing apps to Kubernetes, using declarative automation to deliver immutability of the application and infrastructure.

He was so impressed with the developer-centric approach of Kong that he decided to showcase Konnect, Kong's enterprise SaaS platform, to his immediate team. The team agreed that Konnect was exactly what they needed to modernize their legacy applications and provide a consistent, shared policy layer to all enterprise APIs. And so their journey began.

Modernizing a Legacy Application

Thanks to his stellar demonstration, Josh was tasked with modernizing a legacy application that was slow and cumbersome. The application, a Pig Latin translator, is detailed in this blog post written by David La Motta. David does a great job at improving high availability and disaster recovery (HADR) using Zero Load Balancing (ZeroLB)—a design pattern implemented with Kong Mesh. Although this solved the network redundancy and HADR concerns with ZeroLB, the performance was slow. The legacy application was written in Ansible and Python scripts using asynchronous calls and takes many seconds to return a response.

How can Josh modernize this application in the most efficient way possible, improving the performance and giving it a new lease on life in a multi-cloud, platform-agnostic environment like Kubernetes? Read on or watch the below video to find out.

Design and Develop

Apache Camel has been around for 14 years. It's one of Apache's most mature projects, with over 4,000 stars on GitHub and almost 100 committers from many different vendors (Red Hat, Talend, SAP) and individuals. It is based on the concept of Enterprise Integration Patterns (EIPs) and fits nicely into the service layer tier—responsible for routing, transformation and any other integration heavy lifting.

What Camel lacks is an API gateway layer—a gap often filled by an API management or service mesh platform. Camel has a very nice RESTful Domain Specific Language (DSL) called "Rest DSL." In a couple of lines of code (either Java or XML), you can write a RESTFul service in minutes. Our developer friend Josh is a big fan of REST DSL and was able to quickly knock out the following RESTful endpoint for the Pig Latin application:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

 <camelContext id="CamelPigLatin" xmlns="http://camel.apache.org/schema/spring">

   <restConfiguration apiContextPath="/api-doc" bindingMode="off" component="servlet" contextPath="/camel" enableCORS="true" scheme="http">
     <dataFormatProperty key="prettyPrint" value="true" />
     <apiProperty key="host" value="" />
     <apiProperty key="api.version" value="2.0.0" />
     <apiProperty key="api.title" value="Pig Latin Translator" />
     <apiProperty key="api.description" value="Camel Rest Example with Swagger that provides a Pig Latin translator service" />
     <apiProperty key="api.contact.name" value="Simon Green" />
   </restConfiguration>

   <!-- defines the rest service wrapper for a translator service -->
   <rest consumes="application/json" path="/translate" produces="application/json">
     <description>Rest service, returns the translated pig latin phrase</description>
     <put uri="">
       <description>Translate the phrase</description>
       <param name="body" type="body" description="The english phrase to translate" required="true" />
       <responseMessage code="200" message="Successful Translation" />
       <responseMessage code="500" message="Translation Failed" />
       <to uri="direct:translate" />
     </put>
   </rest>
   <route id="translate">
     <from uri="direct:translate" />
     <convertBodyTo type="java.lang.String" charset="ISO-8859-1" />
     <transform>
       <simple>${body.replaceAll('\\\"', '\"')}</simple>
     </transform>
     <transform>
       <simple>${body.replaceAll('\"\{"','\{\"')}</simple>
     </transform>
     <transform>
       <simple>${body.replaceAll('\"\}\"\}','\"\}\}')}</simple>
     </transform>

     <transform>
       <jsonpath resultType="java.lang.String">$..extra_vars.message</jsonpath>
     </transform>
     <transform>
       <method ref="sampleBean" method="translate" />
     </transform>
   </route>
 </camelContext>
</beans>

The beauty of REST DSL is that it's self-documenting. This makes it easy to include OpenAPI (Swagger) as part of his build. The runtime of choice for Camel is Spring Boot. Other choices are Quarkus or Knative, but unfortunately, they're both in their infancy with limited enterprise support. On the other hand, Spring Boot is portable and easy to get up and running in any environment.

Now that Josh has tested his new Pig Latin endpoint locally, he's inadvertently exposed Swagger documentation. Using his API design tool of choice, Insomnia, Josh's team can import the Swagger and start testing the API.

pig-latin-translator

Although Josh practices the developer-centric "code-first approach" to implementing his application, he's actually created an API contract—the starting point for our API lifecycle journey:

kong-gateway-runtime

As a result, the team completed the Design and Develop phases of our API lifecycle.

Deployment

Next up, we need to deploy our application somewhere. Currently, the existing application is written in Python and calls a RESTful API exposed in Ansible Tower, running on a bunch of VM's on Azure. Although we have network redundancy using Kong Mesh, the performance is slow due to the asynchronous architecture of the Ansible API. Unfortunately, the python client needs to make multiple requests to a) run the Pig Latin playbook and b) retrieve the result. Luckily, Josh has written the RESTful API in Camel using Spring Boot, and the design is inherently synchronous, requiring only a single call from the client.

Since the runtime is Spring Boot, we can easily deploy this to Kubernetes. An extra feature we could use is Terraform to stand up our Kubernetes cluster wherever we want. Josh decided that EKS on AWS was a good place to start this exercise. Terraform allowed Josh to declaratively specify exactly what our deployment should look like, regardless of the cloud provider. Additionally, we now have an immutable deployment that can spool up/tear down with a terraform apply or a terraform destroy.

Phase in New Version

Now that we deployed our modernized application on Kubernetes, it's time to phase in our new version. Typically we'd use the canary deployment technique, but in Josh's case, shifting from an asynchronous to synchronous architecture requires a client code change. Instead, Josh uses API versioning in Kong Konnect to include a new version of the application while guaranteeing backward compatibility for older client versions. Konnect is Josh's favorite API management platform, as it's developer-centric and leaves out the "drag and drop" nonsense that his manager craves. Perfect for any ninja developer!

Now that Josh has configured Konnect to route two different versions of David's Pig Latin application, he's able to test it out. Below you can see the Vitals for multiple versions running through Konnect:

AAP-for-DR-Blog

As a result of Josh's application modernization project, the team experienced the following key improvements:

  • 100 fold performance increase (from a latency of 3 seconds per request down to 30 milliseconds)
  • Ability to seamlessly modernize legacy applications while supporting legacy clients

Josh's manager was so impressed that he decided to decommission the existing legacy architecture and migrate to a more microservices-based architecture using Kong Konnect and Apache Camel.

Further Reading

Hopefully, you found Josh's experience with Kong Konnect useful. Part Two of this series will focus on:

  • Using Kong Mesh to decouple applications from VMs, enabling a seamless migration to any cloud provider.
  • Improving HADR concerns of our newly modernized Pig Latin application.

For more information on this example, or to try it out yourself, visit my GitHub repo.

Lastly, to learn more about Kong Konnect, try one of our hands-on exercises at Kong Academy. Kong Konnect is a single platform that delivers end-to-end connectivity and visibility for services in multi-cloud environments, making application modernization seamless.

API ManagementKong KonnectApplications

More on this topic

Videos

Rapid Application Modernization With Kong Konnect and Apache Camel

Videos

Service Catalog: Unifying Discovery for API Consumers and Producers

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo
Topics
API ManagementKong KonnectApplications
Simon Green

Recommended posts

Modernizing Integration & API Management with Kong and PolyAPI

EngineeringFebruary 9, 2026

The goal of Integration Platform as a Service (iPaaS) is to simplify how companies connect their applications and data. The promise for the first wave of iPaaS platforms like Mulesoft and Boomi was straightforward: a central platform where APIs, sys

Gus Nemechek

Kong MCP Registry: Connect AI Agents with the Right Tools

Product ReleasesFebruary 2, 2026

The Kong MCP Registry acts as a central directory for AI agents and clients to access services that provide context or take action. For AI agents, think of it as a combination of a "Service Catalog" and a "Developer Portal." It offers the metadata,

Jason Harmon

On-Call Oasis: Creating a Peaceful Experience, Especially During the Holidays

EngineeringDecember 12, 2024

Kong Konnect and our code in production Kong Konnect is Kong’s infrastructural SaaS solution. We run the control planes and API management applications for the data planes (API gateway and mesh) that are run by our customers to power their APIs. So

Krzysztof Słonka

Exposing and Controlling Apache Kafka® Data Streaming with Kong Konnect and Confluent Cloud

EngineeringNovember 19, 2024

We announced the Kong Premium Technology Partner Program at API Summit 2024, and Confluent was one of the first in the program. This initial development was all about ensuring that the relationship between Kong and Confluent — from a business an

Claudio Acquaviva

Getting Started With Kong Konnect in 10 Minutes

EngineeringJuly 7, 2023

In this Kong Konnect tutorial, you'll learn how to leverage the platform to manage your API ecosystem from a single easy-to-use interface. We’ll run through how to: Use Konnect Runtime Manager to set up your own Kong Gateway runtime instance i

Adam Bauman

Implementing a Hybrid Kong Konnect Data Plane in Amazon ECS

EngineeringMarch 22, 2023

Application Modernization projects often require their workloads to run on multiple platforms which requires a hybrid model. Kong Konnect is an API lifecycle management platform delivered as a service. The Control Plane, responsible for admin tasks,

Claudio Acquaviva

Enabling Multi-Region for Kong Konnect Cloud

EngineeringOctober 5, 2022

Since the initial launch of Kong Konnect Cloud, one common feature request has (unsurprisingly) been Multi-Region support. Many customers look for SaaS solutions that support a distributed service architecture. Even at its inception, our goal was to

Nick Anderson

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

    • Platform
    • Kong Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2026