1. Home
  2. /
  3. Quarkus Typing Test
  4. /
  5. Simple Counter API

Simple Counter API - Quarkus Typing CST Test

Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master themPractice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM levelTournamentsLive coding speed tournamentsArcade GamesZType, Overkill Survival, Glyphica & moreGamificationXP, coins, badges & quests
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFree ToolsWPM calculator, typing speed report & moreFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & missionSupportGet help — Pro users get priorityContactGet in touch with the team
Pricing
Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Legal & Support

Pro ⚡ PricingContactPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.

Simple Counter API — Quarkus Code

Demonstrates a simple Quarkus REST API with a counter using JAX-RS annotations and in-memory state.

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/counter")
public class CounterResource {
	private int count = 0

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public int getCount() {
		return count
	}

	@POST
	@Path("/increment")
	@Produces(MediaType.APPLICATION_JSON)
	public int increment() {
		return ++count
	}

	@POST
	@Path("/decrement")
	@Produces(MediaType.APPLICATION_JSON)
	public int decrement() {
		return --count
	}

	@POST
	@Path("/reset")
	@Produces(MediaType.APPLICATION_JSON)
	public int reset() {
		count = 0
		return count
	}
}

Quarkus Language Guide

Quarkus is a Kubernetes-native Java framework designed for building cloud-native, high-performance applications. It emphasizes fast startup times, low memory usage, and developer productivity.

Primary Use Cases

  • ▸Microservices development
  • ▸RESTful APIs with JAX-RS
  • ▸Serverless functions and cloud-native apps
  • ▸Reactive event-driven applications
  • ▸Integration with Kubernetes and OpenShift

Notable Features

  • ▸GraalVM native image support for ultra-fast startup
  • ▸Live coding with hot reload
  • ▸Reactive programming support
  • ▸Unified configuration system
  • ▸Extensive extension ecosystem

Origin & Creator

Quarkus was created by Red Hat in 2019 to modernize Java development for cloud-native environments.

Industrial Note

Quarkus is ideal for Java projects requiring high-performance, fast-startup, and cloud-native deployment with containerized environments.

Quick Explain

  • ▸Quarkus provides a modern framework for Java developers targeting cloud, microservices, and serverless architectures.
  • ▸Optimized for GraalVM and HotSpot for fast startup and low memory footprint.
  • ▸Supports reactive programming and imperative APIs.
  • ▸Includes live reload for rapid development cycles.
  • ▸Ideal for microservices, RESTful APIs, and event-driven applications.

Core Features

  • ▸RESTful API development with JAX-RS
  • ▸Dependency injection with CDI
  • ▸Reactive streams and non-blocking I/O
  • ▸Integration with databases via Panache
  • ▸Cloud-native features like Kubernetes/OpenShift integration

Learning Path

  • ▸Learn Java 17+ basics
  • ▸Understand Quarkus application structure
  • ▸Learn JAX-RS for REST endpoints
  • ▸Work with CDI and dependency injection
  • ▸Deploy native images to Kubernetes/OpenShift

Practical Examples

  • ▸REST API for an e-commerce backend
  • ▸Reactive messaging with Kafka
  • ▸CRUD application using Panache ORM
  • ▸Serverless function deployed to OpenShift/Kubernetes
  • ▸Event-driven IoT backend

Comparisons

  • ▸Quarkus vs Spring Boot: Quarkus faster startup and lower memory; Spring Boot more mature ecosystem
  • ▸Quarkus vs Micronaut: Both cloud-native; Quarkus has more Red Hat support
  • ▸Quarkus vs Vert.x: Vert.x is low-level reactive toolkit; Quarkus offers full-stack features
  • ▸Quarkus vs Helidon: Helidon is micro-profile based; Quarkus emphasizes native images
  • ▸Quarkus vs Node.js (Fastify): Java ecosystem vs Node.js, strong typing vs JS flexibility

Strengths

  • ▸Extremely fast startup and low memory footprint
  • ▸Developer-friendly live reload
  • ▸Supports both reactive and imperative programming
  • ▸Rich extension ecosystem for integrations
  • ▸Optimized for containerized/cloud-native deployments

Limitations

  • ▸Java-specific - not suitable for other languages
  • ▸Steeper learning curve for reactive programming
  • ▸Requires understanding GraalVM for native images
  • ▸Less mature compared to Spring ecosystem for some features
  • ▸Initial configuration can be complex for beginners

When NOT to Use

  • ▸Small scripts or lightweight apps not needing Java
  • ▸Applications where fast startup is not critical
  • ▸Teams unfamiliar with Java or reactive programming
  • ▸Projects requiring heavy server-side rendering templates
  • ▸Legacy monolithic apps not targeting cloud-native

Cheat Sheet

  • ▸mvn io.quarkus:quarkus-maven-plugin:create -> create project
  • ▸@Path('/endpoint') -> define REST endpoint
  • ▸@GET/@POST -> define HTTP methods
  • ▸@Inject -> inject CDI bean
  • ▸./mvnw quarkus:dev -> run dev server with live reload

FAQ

  • ▸Is Quarkus free?
  • ▸Yes - open-source under Apache License 2.0
  • ▸Does Quarkus support native images?
  • ▸Yes - via GraalVM and Quarkus build tools
  • ▸Is Quarkus suitable for production?
  • ▸Yes - optimized for cloud-native and microservices
  • ▸Does Quarkus support reactive programming?
  • ▸Yes - via Mutiny and reactive extensions
  • ▸How does Quarkus compare to Spring Boot?
  • ▸Quarkus has faster startup, lower memory, and cloud-native optimizations; Spring Boot has more mature ecosystem

30-Day Skill Plan

  • ▸Week 1: Java and Maven fundamentals
  • ▸Week 2: REST endpoints with JAX-RS
  • ▸Week 3: Dependency injection and CDI beans
  • ▸Week 4: Reactive programming and Mutiny
  • ▸Week 5: Native image compilation and cloud deployment

Final Summary

  • ▸Quarkus is a cloud-native Java framework optimized for fast startup and low memory usage.
  • ▸Supports reactive and imperative programming.
  • ▸Extensive extension ecosystem allows easy integration with DB, messaging, and security.
  • ▸Live reload enhances developer productivity.
  • ▸Ideal for microservices, serverless, and Kubernetes/OpenShift deployments.

Project Structure

  • ▸src/main/java - application code
  • ▸src/main/resources - configuration files
  • ▸src/test/java - unit and integration tests
  • ▸pom.xml / build.gradle - project configuration
  • ▸extensions/ - modular integrations via Quarkus extensions

Monetization

  • ▸Enterprise microservices
  • ▸SaaS backends
  • ▸Event-driven and streaming services
  • ▸Serverless cloud functions
  • ▸Containerized production workloads

Productivity Tips

  • ▸Use Quarkus dev mode for rapid development
  • ▸Leverage extensions for DB, messaging, security
  • ▸Write reactive endpoints for scalable apps
  • ▸Use GraalVM for native image optimization
  • ▸Automate CI/CD deployment pipelines

Basic Concepts

  • ▸Quarkus application - core project structure
  • ▸Endpoints - REST APIs using JAX-RS
  • ▸CDI Beans - dependency-injected components
  • ▸Reactive components - event-driven programming
  • ▸Extensions - modular integrations for DB, messaging, etc.

Official Docs

  • ▸https://quarkus.io/
  • ▸https://github.com/quarkusio/quarkus

More Quarkus Typing Exercises

Quarkus Hello World APIQuarkus Query Parameter ExampleQuarkus JSON Response ExampleQuarkus POST Form ExampleQuarkus Path Parameter ExampleQuarkus Error Handling ExampleQuarkus Redirect ExampleQuarkus Multiple Routes ExampleQuarkus Injected Bean Example

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher