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

Enhancing the development loop with Quarkus remote development

February 11, 2021
Daniel Oh
Related topics:
ContainersJavaKubernetesQuarkus
Related products:
Red Hat OpenShift

    Kubernetes is an established foundation layer for cloud-native microservices and serverless architectures. By automating application deployment, scaling, and management, Kubernetes changes the developer's daily workflow in terms of inner loop development (local coding, building, running, and testing the application) and outer loop development (integration testing, continuous deployment, and security). Developers using Kubernetes also must plan for containerization, debugging code inside pods, and automating test cases.

    In this article, you'll see how using Quarkus remote development enhances the development loop on Kubernetes. We will set up a new Quarkus project then configure it for live coding on a remote Red Hat OpenShift cluster, just like you would in your local development environment.

    Step 1: Create a new Quarkus project

    We’ll use a Maven plug-in to scaffold a new project with the following command:

    $ mvn io.quarkus:quarkus-maven-plugin:2.1.0.Final:create \
        -DprojectGroupId=org.acme \
        -DprojectArtifactId=quarkus-remote \
        -DprojectVersion=1.0.0-SNAPSHOT \
        -DclassName="org.acme.GreeterResource" \
        -Dextensions="openshift"

    This command generates a quarkus-remote directory that includes a new Quarkus project. When you open the GreeterResource.java class file in src/main/java/org/acme, you will see a simple RESTful API:

    @Path("/hello")
    public class GreeterResource {
    
       @GET
       @Produces(MediaType.TEXT_PLAIN)
       public String hello() {
           return "Hello RESTEasy";
       }
    }

    Step 2: Live coding in your local environment

    Quarkus comes with a built-in development mode for hot deployment with background compilation. After changing the code, resources, or configuration in a running application, you only need to refresh your web browser or invoke the project's RESTful API for the changes to take effect automatically. To run your application locally, execute the following command in the project's home directory:

    $ mvn quarkus:dev

    You will see that live coding has been activated:

    INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.

    Invoke the application's RESTful API endpoint with acurl command:

    $ curl http:/localhost:8080/hello

    The output should be:

    Hello RESTEasy

    Return to the GreeterResource.java class file in src/main/java/org/acme. Change the code in the hello() method:

    return "Hello RESTEasy from Local";

    Save the file, then use the same curl command to re-invoke the endpoint. The new output should be:

    Hello RESTEasy from Local

    Invoking the RESTful API triggers a scan of the workspace. If any changes are detected, the Java files are compiled, and the application is redeployed, and the redeployed application services your request. If you check the logs in your running Quarkus runtime, you should see the detected source files:

    INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-4) Changed source files detected, recompiling [/Users/danieloh/Downloads/quarkus-remote/src/main/java/me/daniel/GreeterResource.java]
    

    Hit CTRL+C when you are ready to stop the application.

    Step 3: Build and deploy a mutable application

    What if you want to expand the inner loop development cycle to a remote container environment such as Kubernetes or OpenShift? You can configure your application in remote development mode to make changes to your local files immediately visible in your remote container environment.

    To develop remotely, you need to build a mutable application using the mutable-jar format. You can then use the OpenShift extension and Maven plug-in to deploy the application to your remote OpenShift cluster. Append the following configurations to your Quarkus project's application.properties file:

    # Mutable Jar configurations
    quarkus.package.type=mutable-jar
    quarkus.live-reload.password=changeit
    
    # OpenShift Extension Configurations
    quarkus.container-image.build=true
    quarkus.kubernetes-client.trust-certs=true
    quarkus.kubernetes.deployment-target=openshift
    quarkus.openshift.route.expose=true
    quarkus.openshift.env.vars.quarkus-launch-devmode=true

    Note that you can change the password to whatever you want. It is used to secure communication between the remote side and the local side.

    Open the mutable application in your OpenShift cluster

    To log in to the OpenShift cluster, you have to install the oc command-line interface and use the oc login. Installation options for the CLI will vary depending on your operating system.

    Assuming you have oc installed, execute the following command in your Quarkus project home directory:

    $ oc new-project quarkus-remote
    $ mvn clean package -DskipTests -Dquarkus.kubernetes.deploy=true

    This command creates a new project in the remote OpenShift cluster. The mutable JAR will be packaged and deployed to OpenShift. The output should end with BUILD SUCCESS.

    Check the application in the OpenShift console

    So far, so good. Now, let’s go to the Developer console in the OpenShift cluster and then navigate the Topology view. You will see that your Quarkus application has been deployed. Click on View logs to see how the mutable application is deployed, as shown in Figure 1.

    Figure 1. Topology View
    Figure 1. Topology View
    Figure 1: The new, mutable application in the Topology view.

    You should see the output "Profile dev activated. Live Coding activated" in the pod logs, as shown in Figure 2.

    Figure 2. Pod Logs
    Figure 2. Pod Logs
    Figure 2: The pod logs show that live coding has been activated.

    Check the application's RESTful API

    Go back to the Topology view to access the application's RESTful API. Click the Open URL icon highlighted in Figure 3.

    Figure 3. Open URL
    Figure 3. Open URL
    Figure 3: Open the RESTful API URL

    Append /hello at the application’s route URL. When you check it, you should see the same output in your local environment :

    Figure 4. Access the REST API
    Figure 4. Access the REST API
    Figure 4. Access the REST API

    Step 4: Run the application in remote development mode

    The last step is to connect your local agent to the remote host on OpenShift. To start, append the quarkus.live-reload.url configuration to your application.properties file. Note that you will need to remove or comment the OpenShift extension configurations so that they will not trigger the source-to-image build when you change the code:

    # Mutable Jar configurations
    quarkus.package.type=mutable-jar
    quarkus.live-reload.password=changeit
    quarkus.live-reload.url=http://YOUR_APP_ROUTE_URL
    
    # OpenShift Extension Configurations
    # quarkus.container-image.build=true
    # quarkus.kubernetes-client.trust-certs=true
    # quarkus.kubernetes.deployment-target=openshift
    # quarkus.openshift.expose=true
    # quarkus.openshift.env-vars.quarkus-launch-devmode.value=true

    Use the remote-dev command to execute the remote development mode:

    $ mvn quarkus:remote-dev

    The output should end with Connected to remote server. Now you can develop in the same environment where you will run your app, with access to the same services.

    Next, return to the GreeterResource.java class file in src/main/java/org/acme, then change the code in the hello() method:

    return "Hello RESTEasy from OpenShift";

    Save the file, then refresh the browser. The output should be what you see in Figure 5.

    Figure 5. Reinvoke the RESTful API
    Figure 5. Reinvoke the RESTful API
    Figure 5. Reinvoke the RESTful API

    Every time you refresh the browser, you should see that local changes are immediately visible in the remote application. An HTTP-based long polling transport synchronizes your local workspace and the remote application via HTTP calls. Here's an example of log output in the local Quarkus runtime:

    INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Remote dev client thread) Changed source files detected, recompiling [/Users/danieloh/Downloads/quarkus-remote/src/main/java/me/daniel/GreeterResource.java]
    ...
    
    INFO  [io.qua.ver.htt.dep.dev.HttpRemoteDevClient] (Remote dev client thread) Sending dev/app/me/daniel/GreeterResource.class
    INFO  [io.qua.ver.htt.dep.dev.HttpRemoteDevClient] (Remote dev client thread) Sending quarkus-run.jar
    ...

    Awesome! You should be all set to enjoy your inner loop development experience while implementing your application's new business requirements.

    Note: Using Quarkus's remote development mode in production could cause unexpected functional changes to the running application. Remote development should only be used when the application is in development.

    Conclusion

    You can use Quarkus to enhance the development loop by connecting the live coding features from your local machine to a remote container environment such as OpenShift. Being able to do remote development in a cloud-native Java runtime simplifies the development workflow—from writing code to building, running, debugging, and deploying microservices at speed. See the Quarkus Guides for more about how Quarkus optimizes development productivity through unified configuration, zero-config with live coding, and easy injection of extensions for implementing cloud-native applications.

    Last updated: October 7, 2022

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    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.