DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Enterprise AI Trend Report: Gain insights on ethical AI, MLOps, generative AI, large language models, and much more.

2024 Cloud survey: Share your insights on microservices, containers, K8s, CI/CD, and DevOps (+ enter a $750 raffle!) for our Trend Reports.

PostgreSQL: Learn about the open-source RDBMS' advanced capabilities, core components, common commands and functions, and general DBA tasks.

AI Automation Essentials. Check out the latest Refcard on all things AI automation, including model training, data security, and more.

  1. DZone
  2. Refcards
  3. Getting Started With Quarkus
refcard cover
Refcard #319

Getting Started With Quarkus

In this Refcard, an expert developer walks through the Quarkus platform, an open source Kubernetes-native Java stack that enables smaller, faster Java programs. Learn how to improve the developer experience through features like live reloading, debugging, and more. Its integration with the Eclipse MicroProfile specification also makes it the perfect choice for developing microservices and deploying them in Kubernetes.

Free PDF for Easy Reference
refcard cover

Written By

author avatar Alex Soto
Software Engineer, Red Hat
Table of Contents
► Key Benefits ► Getting Started ► Key Components ► Conclusion
Section 1

Key Benefits

Quarkus offers near-instant scale-up and high-density utilization in container orchestration platforms such as Kubernetes. Many more application instances can be run using the same hardware resources. In Quarkus, classes used only at application startup are invoked at build time and not loaded into the runtime JVM. 

Quarkus also avoids reflection as much as possible. These design principles reduce the size and the memory footprint of an application running on the JVM. Quarkus’ design accounts for native compilation from the onset; optimization for using GraalVM, specifically its native image capability, to compile JVM bytecode to a native machine binary.

Additionally, Quarkus rests on a vast ecosystem of technologies, standards, libraries, and APIs. Developers don’t have to spend lots of time learning an entirely new set of APIs and technologies to take advantage of the benefits Quarkus brings to the JVM or native images.


This is a preview of the Getting Started With Quarkus Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 2

Getting Started

To create a Quarkus service, you just need to run the next Maven goal into an empty directory: 

Java
 




xxxxxxxxxx
1


 
1
mvn io.quarkus:quarkus-maven-plugin:1.13.1.Final:create \
2
-DprojectGroupId=org.acme \
3
-DprojectArtifactId=hello-world \
4
-DclassName="org.acme.quickstart.GreetingResource" \
5
-Dpath="/hello"



Live Reload 

Quarkus applications come with a live reload feature that allows the developer to make changes to their source code, which will be directly reflected in the deployed code without having to recompile or repackage the source code.

Java
 




xxxxxxxxxx
1


 
1
./mvnw compile quarkus:dev



This service is started locally and you can use a curl command on the http://localhost:8080/hello URL to get a response from the service.


This is a preview of the Getting Started With Quarkus Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 3

Key Components

JAX-RS 

Quarkus uses the JAX-RS spec for implementing RESTful web services, as shown below:

Java
 




xxxxxxxxxx
1
41


 
1
@Path("/developer")
2
public class DeveloperResource {
3
 
4
    @GET
5
     @Produces(MediaType.APPLICATION_JSON)
6
    public List<Developer> getAllDevelopers() {}
7
 
8
    @POST
9
     @Produces(MediaType.APPLICATION_JSON)
10
    public Response createDeveloper(Developer developer) {}
11
 
12
    @DELETE
13
    @Path("{id}")
14
     @Produces(MediaType.APPLICATION_JSON)
15
    public Response deleteDeveloper(@PathParam("id") Long id) {}
16
 
17
    @GET
18
     @Produces(MediaType.APPLICATION_JSON)
19
     @Path("search")
20
    public Response searchDeveloper(@QueryParam("skills") String skills) {}
16
 
21
}


 

JSON Marshalling and Unmarshalling 

To marshal and unmarshal Java objects to JSON format, you need to register either the JSON-B or Jackson extension: 

Java
 




xxxxxxxxxx
1


 
1
./mvnw quarkus:add-extension -Dextensions="resteasy-jsonb"



Or:

Java
 




xxxxxxxxxx
1


 
1
./mvnw quarkus:add-extension -Dextensions="resteasy-jackson"




This is a preview of the Getting Started With Quarkus Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 4

Conclusion

Java has evolved since its introduction in 1995, but more importantly, the environments hosting applications have evolved as well. Some trade-offs made in Java’s design at the onset affect how Java is perceived today. Things that were important in those days aren’t as important anymore. Quarkus was invented given the challenges and problems of today and aims to solve those challenges without forcing developers to learn an entirely new programming language.

This Refcard has shown how to use some of the most common extensions within the Quarkus ecosystem. Please visit https://code.quarkus.io for a list of all extensions as well as https://quarkus.io/guides/ for further information on building Quarkus applications.


This is a preview of the Getting Started With Quarkus Refcard. To read the entire Refcard, please download the PDF from the link above.

Like This Refcard? Read More From DZone

related article thumbnail

DZone Article

Advanced Process Integration Tips - Quarkus Applications
related article thumbnail

DZone Article

Building a REST API With Quarkus
related article thumbnail

DZone Article

Camel Quarkus With CouchDB Component
related article thumbnail

DZone Article

Maximize Kubernetes Security: Automate TLS Certificate Management With Cert-Manager on KIND Clusters
related refcard thumbnail

Free DZone Refcard

Introduction to Cloud-Native Java
related refcard thumbnail

Free DZone Refcard

Java 15
related refcard thumbnail

Free DZone Refcard

Java 14
related refcard thumbnail

Free DZone Refcard

Getting Started With Headless CMS

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.linkDescription }}

{{ parent.urlSource.name }}
by
DZone Core CORE
· {{ parent.articleDate | date:'MMM. dd, yyyy' }} {{ parent.linkDate | date:'MMM. dd, yyyy' }}
Tweet
{{ parent.views }} ViewsClicks
  • Edit
  • Delete
  • {{ parent.isLocked ? 'Enable' : 'Disable' }} comments
  • {{ parent.isLimited ? 'Remove comment limits' : 'Enable moderated comments' }}