Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

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 ToolsetPodman DesktopRed Hat build of Apache Camel

    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

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

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

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.