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

10 reasons to develop Quarkus applications on Red Hat OpenShift

January 15, 2021
Jeff Beck
Related topics:
JavaKubernetesQuarkusServerless
Related products:
Red Hat OpenShift

Share:

    Combining Quarkus with Red Hat OpenShift provides an ideal environment for creating scalable, fast, and lightweight applications. Quarkus significantly increases developer productivity with tooling, pre-built integrations, application services, and more. This article presents 10 reasons why you should develop your Quarkus applications on OpenShift.

    Reason 1: One-step OpenShift deployment

    You don’t have to be an OpenShift expert to deploy Quarkus applications. The Quarkus OpenShift extension automatically generates OpenShift resources, making it easy to get started. The extension provides multiple deployment options, including Jib, Docker, and Source-to-Image (S2i). It also creates a DeploymentConfig, which triggers an automatic redeployment whenever a change is detected in the ImageStream.

    Here is a simple example of a Quarkus deployment on OpenShift:

    //deploy JVM-based app on OpenShift
    //add OpenShift extension
    mvn quarkus:add-extension -Dextensions="openshift"
    
    //application.properties
    quarkus.s2i.base-jvm-image=
    quarkus.openshift.expose=true
    
    mvn clean package -Dquarkus.kubernetes.deploy=true
    

    Learn more: Deploying Quarkus on OpenShift.

    Reason 2: One-step serverless function deployment

    Quarkus applications, especially those compiled to native code, are ideal for serverless applications due to their small size and fast boot times. The Quarkus OpenShift extension also makes it easy to deploy and scale Knative serverless services. As a developer, you don’t need to worry about server provisioning or maintaining the underlying infrastructure. You simply write your code and package it in a container for deployment.

    Here is an example of a serverless function deployment:

    //deploy serverless knative app on OpenShift
    //add OpenShift extension
    mvn quarkus:add-extension -Dextensions="openshift"
    
    //application.propertiesquarkus.s2i.base-jvm-image=
    quarkus.kubernetes.deployment-target=knative
    mvn clean package -Dquarkus.kubernetes.deploy=true
    

    Learn more: Using Knative via OpenShift Serverless.

    Reason 3: Live coding

    The traditional Java development workflow is a major drain on productivity. It can take minutes to complete each iteration in a cycle. The Quarkus live coding feature solves this problem. Figure 1 illustrates an example workflow when running in development mode.

    The write and refresh development cycle in Quarkus
    Figure 1: The write and refresh development cycle in Quarkus.

    Here's the command to run Quarkus in development mode:

    mvn compile quarkus:dev
    

    Given this command, Quarkus checks to see if any application source files have changed. If they have, Quarkus transparently compiles the changed files and redeploys the application.

    Learn more: Live coding with Quarkus.

    Reason 4: Remote development and debugging

    You can also do live coding remotely, in development mode, in a clustered OpenShift or Kubernetes environment. Any changes you make locally will be immediately visible in the clustered environment. Remote development and debugging lets you create applications in the same environment where your applications will run. The key is building a mutable application:

    //application.properties
    quarkus.package.type=mutable-jar
    quarkus.live-reload.password=abc123
    quarkus.kubernetes.env.vars.QUARKUS_LAUNCH_DEVMODE=true
    
    //Deploy
    mvn clean install -Dquarkus.kubernetes.deploy=true
    
    //Start
    mvnw quarkus:remote-dev -Dquarkus.live-reload.url=
    

    Learn more: Building Quarkus applications in remote development mode.

    Reason 5: Access to OpenShift ConfigMaps and secrets

    Quarkus includes a kubernetes-config extension that lets you use Kubernetes ConfigMaps and secrets as a configuration source. You never even have to mount them into the pod running your Quarkus application. Instead, your Quarkus application reads ConfigMaps and secrets directly from the Kubernetes API server using the Kubernetes client:

    //application.properties
    quarkus.kubernetes-config.enabled=true
    quarkus.kubernetes-config.secrets.enabled=true
    quarkus.kubernetes-config.config-maps=
    
    mvn clean package -Dquarkus.kubernetes.deploy=true
    

    Learn more: The Quarkus kubernetes-config extension.

    Reason 6: Health endpoints

    Quarkus uses the MicroProfile Health specification (via the SmallRye extension) to provide information about the application state, such as availability and status. This information is useful in cloud environments where automated processes must frequently determine whether to discard or restart an application. Most Quarkus client extensions have built-in health status enabled by default:

    //add Kubernetes-config extension
    mvn quarkus:add-extension -Dextensions="smallrye-health"
    
    //validate health extension
    mvnw compile quarkus:dev
    curl http://localhost:8080/health/live
    
    //org.acme.microprofile.health.SimpleHealthCheck class
    package org.acme.microprofile.health;
    import org.eclipse.microprofile.health.HealthCheck;
    import org.eclipse.microprofile.health.HealthCheckResponse;
    import org.eclipse.microprofile.health.Liveness;
    import javax.enterprise.context.ApplicationScoped;
    
    @Liveness
    @ApplicationScoped
    
    public class SimpleHealthCheck implements HealthCheck {
    
    @Override
    public HealthCheckResponse call() {
    return HealthCheckResponse.up("Simple health check");
    }
    }
    

    Learn more: Using the MicroProfile Health specification in Quarkus.

    Reason 7: Application metrics support

    Quarkus uses the Micrometer extension to support capturing runtime and application metrics. These metrics provide insight into what is happening inside the application. You can also format Micrometer extension metrics for processing with tools like Prometheus and Grafana, which support analysis and visualization:

    //add Kubernetes-config extension
    mvn quarkus:add-extension -Dextensions="micrometer"
    
    //validate health extension
    mvnw compile quarkus:dev
    
    //Code snippet to discover, count, store, and record prime numbers
    @Path("/")
    public class PrimeNumberResource {
    
    private final LongAccumulator highestPrime = new LongAccumulator(Long::max, 0);
    
    private final MeterRegistry registry;
    
    PrimeNumberResource(MeterRegistry registry) {
    this.registry = registry;
    // Create a gauge to obtain the highest observed prime number
    registry.gauge("prime.number.max", this,PrimeNumberResource::highestObservedPrimeNumber);}
    
    // Return the highest observed prime value
    long highestObservedPrimeNumber() {
    return highestPrime.get();}
    }
    

    Learn more: The MicroProfile Metrics API in Quarkus.

    Reason 8: Tracing support

    Quarkus uses the MicroProfile OpenTracing specification (via the SmallRye extension) to provide distributed tracing across services for interactive web applications. The SmallRye extension includes the default Jaeger tracer to monitor and troubleshoot transactions in a distributed system:

    //add Kubernetes-config extension
    mvn quarkus:add-extension -Dextensions="smallrye-opentracing"
    
    //validate health extension
    mvnw compile quarkus:dev
    
    //REST endpoints are automatically traced. Here's how to trace additional methods
    import javax.enterprise.context.ApplicationScoped;
    import org.eclipse.microprofile.opentracing.Traced;
    
    @Traced
    @ApplicationScoped
    public class FrancophoneService {
    public String bonjour() {
    return "bonjour";}
    }
    

    Learn more: Using OpenTracing in Quarkus applications.

    Reason 9: Developer tooling

    You might come for the performance, but you'll stay for the developer productivity. Developer tooling makes it even easier to develop and deploy Quarkus applications on OpenShift. Here are a few examples:

    • IDE support: Quarkus utilizes the Quarkus Language Server to support your favorite IDE, including VSCode, Eclipse, IntelliJ, and more.
    • Build tools: Quarkus also supports Maven and Gradle build tools.
    • Codestarts: Extension codestarts include code examples and documentation to make it easier for developers new to Quarkus to create applications.

    Reason 10: Compatibility with Spring APIs

    Spring is a dominant Java framework for developers, but Spring applications were not designed for cloud-native environments like OpenShift. Quarkus, on the other hand, was created and optimized for the cloud. As a result, Quarkus can reduce cloud-resource efficiency by up to 64%.

    If you need cloud-native efficiency but prefer to stick with the framework you know, Quarkus provides a Spring-compatibility layer. This means you can create applications using the Spring APIs you are familiar with, including data, web, config, security, dependency injection, and more. Here's an example of Spring web development in Quarkus:

    //Spring Web example
    import java.util.List;
    import org.springframework.web.bind.annotation.*;
    
    @RestController
    @RequestMapping("/person")
    public class PersonController {
    @GetMapping(path = "/greet/{id}", produces = "text/plain")
    
    public String greetPerson(@PathVariable(name = "id") long id) {
    String name="";
    return name;
    }
    
    @GetMapping(produces = "application/json")
    public Iterable findAll() {
    return personRepository.findAll();
    }
    

    Learn more: Quarkus for Spring developers.

    Get started with Quarkus

    I hope the availability of developer tooling, pre-built integrations, and application services inspires you to develop your first Quarkus application on OpenShift. These additional resources will help you get started:

    • Interactive tutorials: The Quarkus homepage includes numerous interactive tutorials that walk you through building Quarkus applications in a pre-configured OpenShift environment.
    • Generate a Quarkus project: Quarkus project initializers make it easy to select extensions and generate sample applications for both the community and Red Hat builds of Quarkus.
    • OpenShift access: Red Hat provides several options for accessing an OpenShift environment, including the developer sandbox shown in Figure 2.
      The sandbox include quick starts, samples, and a variety of deployment options.
      Figure 2: The OpenShift developer sandbox.

      Learn more about the possibilities of using a Red Hat OpenShift 4 cluster on your computer, in your datacenter, and more.

     

    Last updated: January 2, 2024

    Recent Posts

    • Expand Model-as-a-Service for secure enterprise AI

    • OpenShift LACP bonding performance expectations

    • Build container images in CI/CD with Tekton and Buildpacks

    • How to deploy OpenShift AI & Service Mesh 3 on one cluster

    • JVM tuning for Red Hat Data Grid on Red Hat OpenShift 4

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

    Red Hat legal and privacy links

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

    Report a website issue