Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat 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
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud 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

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • 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

Simplify local prototyping with Camel JBang infrastructure

August 28, 2025
Bruno Meseguer
Related topics:
Application modernizationContainersDeveloper ProductivityDeveloper ToolsEvent-DrivenIntegrationIDEsJavaJava MicroservicesKafkaMicroservices
Related products:
AMQ BrokerAMQ ClientsDeveloper ToolsPodman DesktopRed Hat build of Apache Camel

Share:

    Apache Camel is an open source integration framework that simplifies connecting and mediating with systems like databases, messaging platforms, or APIs. It enables developers to create integration flows with minimal code. Camel JBang is a command-line interface (CLI) that accelerates prototyping by letting developers quickly create, validate, and tweak these flows without complex setups, making it perfect for rapid experimentation.

    A key feature of Camel JBang is its infra command. It allows developers to launch backends like Kafka, databases, or FTP servers instantly, avoiding the complexity of managing infrastructure. The infra command uses the power of Testcontainers and Docker (or Podman), deploying real systems and saving developers from the hassle of preparing mocks and complicated environment configurations.

    For example, to try out an integration flow with a Kafka messaging system, you might generally need to set up a cluster with multiple containers or pods, which can be time-consuming and costly. When you run a command like camel infra run kafka, Camel JBang uses Testcontainers to access your local Docker environment. It pulls a Kafka image, starts a container, and displays connection details on your screen. You can then set up your Camel route to send or receive messages, experimenting locally with ease.

    Let’s see the infra command in action in the example below, where you'll see the developer focus on prototyping a solution locally, avoiding time-consuming and tedious infrastructure preparations.

    Demo: Modernizing a Legacy API with camel infra

    This section demonstrates how camel infra helps modernize a legacy XML-based API, like the one represented in Figure 1.

    Original API service
    Figure 1: Original API service.

    The goal is to expose the service as a JSON-based API and decouple it from the legacy system using AMQP messaging using AMQ (ActiveMQ). The upgrade brings 2 significant benefits:

    • Enable JSON clients to connect and integrate.
    • Enable internal event-driven systems to plug in.
    Service Facade (JSON-based)
    Figure 2: Service facade (JSON-based).

    camel infra lets you spin up an Artemis (ActiveMQ) instance locally to test this setup efficiently, streamlining development.

    Watch the demo video

    The following video presents a run-through of the steps described in this article.

    Demo steps

    1. Quickly look at the legacy API.
    2. Launch an instance of AMQP (Artemis) using camel infra.
    3. Add an AMQP entry point to the legacy API and test it.
    4. Create a new, decoupled (via AMQP), JSON-based facade.

    The snippets below are minimalistic but functional to help you understand the core concept. Let’s get started.

    1. Quickly look at the legacy API

    The following Camel route definition implements the legacy API service:

    - route:
        from:
          uri: platform-http:/s1
          steps:
            - setBody:
                simple: <data><customer>${header.id}</customer></data>

    Calling the preceding Camel service using curl will give the following output:

    > curl 'localhost:8080/s1?id=123'
    <data><customer>123</customer></data>

    Passing the customer id as a query parameter gives us XML data with the customer identifier 123 included.

    2. Launch an instance of AMQP using camel infra

    This is the key moment we've been waiting for: to see camel infra in action.

    Before implementing the new AMQP entry point in Camel, we will use Camel JBang (CLI) to launch an infra instance of an Artemis broker. From a terminal, issue the following command:

    > camel infra run artemis
    Starting service artemis
    {
      "brokerPort" : 61616,
      "password" : "artemis",
      "remoteURI" : "tcp://localhost:61616",
      "restart" : null,
      "serviceAddress" : "tcp://localhost:61616",
      "userName" : "artemis"
    }
    Press any key to stop the execution
    

    The infra command locates our local Docker environment, downloads an image with Artemis, launches a container, and prints out the connectivity details.

    You can run the following command to view all running instances:

    > camel infra ps
     ALIAS             IMPLEMENTATION  DESCRIPTION                                     
     artemis           amqp            Apache Artemis is an open source message broker

    The Artemis broker is up and running. It even has a visual dashboard we will use later for testing.

    3. Create the AMQP entry point

    Next, we use the infra's remoteURI parameter value to include in the Camel definition the bean that provides AMQP connectivity to Camel.

    - beans:
        - name: amqpConnection
          type: "#class:org.apache.qpid.jms.JmsConnectionFactory"
          properties:
            remoteURI: amqp://localhost:61616

    Then, in the same file definition, we include the new listener, which is almost identical to the HTTP entry point:

    - route:
        from:
          uri: amqp:topic:customer.request
          parameters:
            connectionFactory: "#amqpConnection"
          steps:
            - setBody:
                simple: <data><customer>${header.id}</customer></data>

    Both processes (HTTP/AMQP entrypoints) can also be modeled using Kaoto, the VS Code extension you can install to design Camel processes. Figure 3 shows the Camel routes that Kaoto visually generates.

    Camel route definitions in Kaoto
    Figure 3: Camel route definitions in Kaoto.

    The AMQP Bean connector is also visible and configurable in Kaoto (Figure 4).

    AMQP bean definition in Kaoto
    Figure 4: AMQP bean definition in Kaoto.

    Test the AMQP listener

    Once the changes are applied, you can open the Artemis UI, which is included in the Camel infra AMQP instance, to test the new AMQP entry point. Open it in your browser by pointing to the following local address: http://localhost:8161

    Log in using the artemis/artemis credentials. Navigate the UI, find the page from where you can send messages, and publish the event to the queue, as illustrated in Figure 5.

    Artemis admin console, send message.
    Figure 5: Sending a message in the Artemis admin console.

    We provide a header ID, equivalent to the customer ID via HTTP, and the JMSReplyTo header, which indicates the queue where Camel should send the response.

    When the message is sent, Camel consumes the event, generates the XML response, maps the customer ID, and uses the reply queue to respond.

    When Camel responds, Artemis automatically creates the queue where the response is kept. You can navigate the UI and browse the response queue to inspect the available messages and show their content, as illustrated in Figure 6.

    Artemis admin console, browse message.
    Figure 6: Artemis admin console browse message.

    Iin Figure 6 (pointer 3), we observe the XML response produced by Camel. The test validates that the new AMQP listener in Camel is operating as expected.

    Camel JBang also comes in handy to validate the result. The command below instructs Camel JBang to connect to the response queue, consume the message, and print it out:

    > camel cmd receive --endpoint='activemq:test.response'
    Waiting for messages ...
    Received Message: (1)
      Endpoint  activemq://test.response 
      Message   (JmsMessage) 
      Header    (Long)                            CamelMessageTimestamp  1754575901933... 
      Header    (null)                                 JMSCorrelationID  null                                           
      Header    (null)                          JMSCorrelationIDAsBytes  null                                           
      Header    (Integer)                               JMSDeliveryMode  2                                                        
      Header    (org.apache.qpid.jms.JmsQueue)           JMSDestination  test.response                                            
      Header    (Long)                                    JMSExpiration  0                                                        
      Header    (String)                                   JMSMessageID  ID:eb89d16b-3...          
      Header    (Integer)                                   JMSPriority  4                                                        
      Header    (Boolean)                                JMSRedelivered  false                                                    
      Header    (org.apache.qpid.jms.JmsQueue)               JMSReplyTo  test.response                                            
      Header    (Long)                                     JMSTimestamp  1754575901933                                            
      Header    (null)                                          JMSType  null                                           
      Header    (Integer)                             JMSXDeliveryCount  1                                                        
      Header    (null)                                      JMSXGroupID  null                                           
      Header    (null)                                       JMSXUserID  null                                           
      Header    (String)                                             id  456                                                      
      Body      (String) (bytes: 39) 
      <data><customer>456</customer></data>

    4. Create the JSON-based facade

    This is the final piece that exposes the new JSON interface. This layer is just a facade of the existing XML entry point where the original service implementation is kept intact, but decoupled from AMQP.

    Remember, Camel allows defining routes using Java, XML, or YAML. It also has Kaoto as a low-code design tool. The following definition is expressed in YAML and can be opened with Kaoto:

    - beans:
        - name: amqpConnection
          properties:
            remoteURI: amqp://localhost:61616
          type: "#class:org.apache.qpid.jms.JmsConnectionFactory"
          
    - route:
       from:
         uri: platform-http:/facade/s1
         steps:
           - to:
               uri: amqp
               parameters:
                 connectionFactory: "#amqpConnection"
                 destinationName: customer.request
                 destinationType: topic
                 replyTo: customer.response
           - to:
               uri: xj
               parameters:
                 resourceUri: identity
                 transformDirection: XML2JSON

    You can edit or open the above definition using Kaoto, which displays it as illustrated in Figure 7.

    Service Façade definition in Kaoto
    Figure 7: Service facade definition in Kaoto.

    The new Camel route bridges incoming HTTP requests to request/reply AMQP interactions. It also transforms the XML response into JSON using the XJ Camel component.

    Calling the new service by issuing a curl command results in:

    > curl -s 'localhost:8080/facade/s1?id=789' | jq
    {
      "customer": "789"
    }

    Final words 

    The infra command in Camel JBang is valuable for quick experiments or validating flows before scaling to production. It supports various backends, such as AMQP (Artemis in the demo), Kafka, databases, or FTP servers. The Camel JBang CLI lets you list available infra options, run multiple services, stop them, view connection details, or check logs for debugging.

    Whether you're new to Apache Camel or an experienced developer, infra makes the process of connecting and validating integration flows straightforward and efficient. Explore camel infra in Camel JBang to simplify your development process.

    Want to learn more?

    Here are some recommended resources for additional learning:

    • Visit the Apache Camel page on Red Hat Developer to learn more about the capabilities of Apache Camel.
    • Try Apache Camel in the Red Hat Developer Sandbox. No local installs are needed, and it's fully web-based. If you're new to the sandbox, read How to access the Developer Sandbox for Red Hat OpenShift.
    • Try combining Camel and AI in this easy tutorial.

    Related Posts

    • Try Apache Camel: From concept to deployment on OpenShift

    • Tutorial: Tool up your LLM with Apache Camel on OpenShift

    • Integration Powers AI: Apache Camel at Devoxx UK 2025

    • What’s new in Red Hat build of Apache Camel 4.10

    • Implement AI-driven edge to core data pipelines

    • Build an extendable multichannel messaging platform

    Recent Posts

    • Simplify OpenShift installation in air-gapped environments

    • Dynamic GPU slicing with Red Hat OpenShift and NVIDIA MIG

    • Protecting virtual machines from storage and secondary network node failures

    • How to use OCI for GitOps in OpenShift

    • Using AI agents with Red Hat Insights

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2025 Red Hat

    Red Hat legal and privacy links

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

    Report a website issue