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

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

  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 is a Kubernetes-Native Java stack tailored to GraalVM and OpenJDK HotSpot, helping Java programs run 10X faster, while being 100X smaller. Improving the developer experience, Quarkus provides additional features like live reloading and debugging as well as persistence with Panache. 

Its integration with the Eclipse MicroProfile specification also makes it the perfect choice for developing microservices and deploying them in Kubernetes.


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

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

Breaking to Build Better: Platform Engineering With Chaos Experiments
related refcard thumbnail

Free DZone Refcard

Java Application Containerization and Deployment
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

ABOUT US

  • About DZone
  • Support and 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
  • [email protected]

Let's be friends: