Skip to content

Quarkus framework based example of the micro-service with HTTP endpoints (often called as REST) and multiple additional features.

License

Notifications You must be signed in to change notification settings

starichkov/quarkus-micro-service

Repository files navigation

GitHub Workflow Status (with event) codecov GitHub license

Quarkus microservice

This project is a Quarkus framework based, 'ready-to-play' micro-service.

Name Version
Java 21
Maven 3.8.1+
Quarkus 3.27.1 (LTS)
PostgreSQL 17.6
Valkey 7.2.10
Testcontainers 2.0.x

What's inside?

Starting from Quarkus 3.20.x this project main branch will be using only LTS version.

Separate edge branch will be using latest versions, and when it will reach next LTS one it will be merged to main.

Quarkus extensions-based features

This service contains multiple features which requires some specific servers to be available and resolvable:

Feature Requirement How to run in Docker How to disable
Database PostgreSQL postgres.md - required -
Valkey Valkey server valkey.md
OpenTelemetry Jaeger server jaeger.md
Metrics Prometheus metrics.md quarkus.micrometer.enabled=false

Health check

These endpoints are available via following URLs:

GET http://localhost:8080/q/health
GET http://localhost:8080/q/health/live
GET http://localhost:8080/q/health/ready

Also, there is Health UI provided too:

http://localhost:8080/q/health-ui/

Docker

This service contains two Dockerfile-s, more details on the separate page.

3rd party libraries features

  • Lombok + Mapstruct (with Mapstruct's CDI mode)

What's the plan?

List of features I am planning to add:

  • Async controller endpoints
  • Hibernate ORM with Panache (official guide)
  • WebSocket support
  • AMPQ support
  • Migrate to multi-module Maven project
  • Native Build with GraalVM

Native executable with GraalVM

Build

mvn clean verify -Dnative

Dependencies

sudo apt install zlib1g-dev

Run

export DB_USERNAME=...
export DB_PASSWORD=...
./target/quarkus-micro-service-1.0.0-runner

Limitations found

Quarkus does not support/provide:

  • Redis as a persistence layer for caching extension. It means you can't use Quarkus @Cache** annotations with underlying Redis. And Quarkus itself will not allow to implement such layer easily - caching extension does not accept custom CacheManager or cache types.

  • AOP (AspectJ) as Spring does. Partially similar behavior could be achieved via Interceptors, but it is still quite a different thing...

License

See the LICENSE file for license rights and limitations (MIT).

About

Quarkus framework based example of the micro-service with HTTP endpoints (often called as REST) and multiple additional features.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •