Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Normalize web services with Camel K and AtlasMap, Part 1

November 24, 2021
Bruno Meseguer
Related topics:
APIsContainersEvent-DrivenJavaKubernetes
Related products:
Red Hat OpenShift

Share:

    This two-part series walks through a simple way to normalize and connect services through Camel K, a part of the Apache Camel project. The scenario in this article addresses a common problem today: Organizations find themselves with a menagerie of different services using different APIs, perhaps because of partnerships or acquisitions.

    Apache Camel makes it easy to harmonize and normalize the APIs, and its Camel K extension brings Apache Camel's operations to Kubernetes, allowing containers to expose these endpoints.

    In this article, we will focus on the benefits of choosing this framework and provide an overview of our base integration flow using Camel K to normalize a backend API. Part 2 shows you how to implement the integration flow step-by-step. We'll also cover how to simplify data mapping with AtlasMap.

    Apache Camel: A framework for all API endpoints

    For many reasons, a lot of organizations need to develop new, front-facing APIs to normalize access to their backend services. Legacy systems can still expose XML over REST or SOAP or might require non-HTTP communication. Over time, the organization might also need to integrate new systems, such as from partnerships or acquisitions. An extra layer of APIs provides a consistent interface to the diverse systems that lie beneath (Figure 1).

    The API layer normalizes and exposes access to core systems, and extends to acquired and partner systems.
    Figure 1. The API layer normalizes and exposes access to core systems, and extends to acquired and partner systems.

    When planning a front-facing layer to standardize access, it's essential to adopt a common framework, as when designing a manufacturing production line. The lack of a common framework can slow down the rollout of services and result in a landscape of systems different from one another. The result is simply impractical and a lot harder to maintain.

    Nowadays, most services are exposed using the OpenAPI specification and communicate through JSON data structures. Plenty of examples from different languages and frameworks are available online, showing how to construct APIs. How do you pick one out of so many choices?

    For starters, your framework should have integration characteristics. More specifically, ensure that the framework excels at least in these essential elements:

    • REST definitions
    • Data transformations
    • Rich connectivity
    • Developer-friendly domain-specific language (DSL)

    In all of these requirements, Apache Camel shines. Apache Camel is solid at solving corner cases, thus minimizing the need to seek alternative solutions when confronting complex problems.

    About Camel K

    The latest evolution of Apache Camel is Camel K, our choice in this article. While Apache Camel implements the integration framework, Camel K lowers the barrier to running integrations in container environments by promoting Camel integrations to first-class citizens in Kubernetes. In addition, Camel K offers a set of key benefits that include:

    • Efficiency: Camel K uses Quarkus as its base runtime. Quarkus has a low memory footprint and offers subsecond boot times and restarts.
    • Developer joy: Camel K provides live coding reloads and automatic dependency resolution.
    • Low-code and templating: Kamelets and KameletBindings are two Camel K constructs that expand its reusability and wider audience consumption.
    • Native connectivity: Camel K provides native integration with cloud services such as Apache Kafka and Knative.
    • Serverless integration: Camel K detects and enables serverless capabilities to run integrations.

    I have provided a list of resources at the end of this article to guide you toward further exploration of Camel K.

    Camel K implementation overview

    This article starts with the goal of defining our base integration flow using Camel K to normalize a backend API. In our example, our backend serves an XML service via HTTP, and we want to expose it as an endpoint compatible with OpenAPI. All the code for the example can be found in a GitHub repository. You can also watch this companion video where I execute the use case described in this article.

    We'll go through the following steps to construct our Camel K implementation:

    1. Inspect the service interface for the backend core capability.
    2. Design an OpenAPI definition that simplifies and normalizes access.
    3. Create data mapping definitions for runtime execution.
    4. Define a Camel route that implements the end-to-end flow.

    Figure 2: Order and locations of tasks to complete.
    Figure 2. The order and locations of tasks to be completed.

    Coming up: How to implement the Camel K integration

    In the next part of this series, we'll dive into each of the tasks illustrated in Figure 2 in detail. We will put on our developer hats and examine the necessary actions to implement the integration flow, including data mapping with AtlasMap. Jump to Part 2 now.

    Learn more about Camel K

    See the following resources to learn more about Camel K and Red Hat's support for it:

    • A good place to start learning about Camel K is the Camel K landing page on Red Hat Developer.
    • See the article Improve cross-team collaboration with Camel K for a fun use case using Camel K.
    • Get a hands-on introduction to Camel K with our collection of interactive tutorials.
    • Learn more about Camel K at the Apache Camel site.
    • Be sure to visit the GitHub repository for the normalized API layer demo featured in this article.
    • Look ahead by watching the video of the Camel K implementation discussed in Part 2.
    OSZAR »
    Last updated: October 8, 2024

    Related Posts

    • Six reasons to love Camel K

    • Event-driven serverless applications with Camel K

    • Design event-driven integrations with Kamelets and Camel K

    • Call an existing REST service with Apache Camel K

    • Normalize web services with Camel K and AtlasMap, Part 2

    Recent Posts

    • Container starting and termination order in a pod

    • More Essential AI tutorials for Node.js Developers

    • How to run a fraud detection AI model on RHEL CVMs

    • How we use software provenance at Red Hat

    • Alternatives to creating bootc images from scratch

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue

    OSZAR »