All Projects → radcortez → microprofile-samples

radcortez / microprofile-samples

Licence: other
Showcases typical use cases of Quarkus Applications

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to microprofile-samples

graphql-example
A MicroProfile GraphQL Example
Stars: ✭ 44 (+62.96%)
Mutual labels:  quarkus, smallrye
18-comic-finder
禁漫天堂Github Actions下载器🧘
Stars: ✭ 264 (+877.78%)
Mutual labels:  quarkus
bobbycar
IoT Transportation demo using Red Hat OpenShift and Middleware technologies
Stars: ✭ 33 (+22.22%)
Mutual labels:  quarkus
quarkus-amazon-lambda
A simple demo application showing quarkus usage with Amazon Lambdas
Stars: ✭ 22 (-18.52%)
Mutual labels:  quarkus
keycloak-phone-provider
A Keycloak provider which phone and SMS
Stars: ✭ 83 (+207.41%)
Mutual labels:  quarkus
quarkus-resteasy-problem
Unified error responses for Quarkus REST APIs via Problem Details for HTTP APIs (RFC7807). Supports Quarkus 2.0+ and 1.4+
Stars: ✭ 36 (+33.33%)
Mutual labels:  quarkus
openshift-quickstart
Developer Workshops related to the Java development on OpenShift
Stars: ✭ 19 (-29.63%)
Mutual labels:  quarkus
opta-invest
Spring Boot/Quarkus/Micronaut + Optaplanner Portfolio Optimization
Stars: ✭ 21 (-22.22%)
Mutual labels:  quarkus
Certified-Rancher-Operator-Thai
มาเรียนรู้ Kuberntes แบบ On-Premise และ Architecture ของ Rancher ที่ใช้ในการจัดการ Kubernetes Cluster เพื่อนำสู่ Certified Kubernetes Administrator และ Certified Rancer Operator
Stars: ✭ 78 (+188.89%)
Mutual labels:  quarkus
native-java-examples
Native Java Apps with Micronaut, Quarkus, and Spring Boot
Stars: ✭ 44 (+62.96%)
Mutual labels:  quarkus
heterogeneous-microservices
Implementation of the same simple microservice on different frameworks
Stars: ✭ 43 (+59.26%)
Mutual labels:  quarkus
Trotsky
a cloud native ✏️ blog platform 一个正在开发中的云原生笔记平台
Stars: ✭ 27 (+0%)
Mutual labels:  quarkus
quarkus-workshops
Hosts Quarkus related workshops
Stars: ✭ 135 (+400%)
Mutual labels:  quarkus
intellij-quarkus
IntelliJ Quarkus Tools
Stars: ✭ 83 (+207.41%)
Mutual labels:  quarkus
quarkiverse
Repository for contributing to quarkiverse wiki
Stars: ✭ 29 (+7.41%)
Mutual labels:  quarkus
jeeshop
No description or website provided.
Stars: ✭ 39 (+44.44%)
Mutual labels:  quarkus
examples
Example code for the Quarkus for Spring Developers eBook
Stars: ✭ 22 (-18.52%)
Mutual labels:  quarkus
harry-potter-quarkus
Showcases in a web application Quarkus and Infinispan
Stars: ✭ 16 (-40.74%)
Mutual labels:  quarkus
base-starter-flow-quarkus
A project base/example for using Vaadin with Quarkus
Stars: ✭ 23 (-14.81%)
Mutual labels:  quarkus
nxrocks
Set of Nx plugins to enhance your Nx workspace (even more!)
Stars: ✭ 165 (+511.11%)
Mutual labels:  quarkus

Quarkus Playground

The purpose of this Github repository is to showcase typical use cases of Quarkus in applications development.

Pre Requisites

Project Structure

The project is a backend for a book store. It provides a REST API to Create, Read, Update and Delete books, and a REST API to retrieve the ISBN of the book.

  • number-api - A service to generate configurable Numbers.
  • book-api - A service to manage books.
  • standalone - A standalone client to call the Book API.
  • simulator - A client simulator that generates random requests to the Book API and simulate traffic.

SmallRye APIs

The following SmallRye APIs can be found through the project:

  • Config (to generate the prefix of the Number API generation)
  • OpenAPI (to document the REST API of both Number API and Book API)
  • JWT (to authenticate and authorize calls that manage books)
  • Fault Tolerance (to handle ISBN book generation if Number API cannot be called)
  • Open Tracing (to trace calls between Book API and Number API)
  • Reactive Messaging (to store Books that require ISBN book generation due to failure)
  • Metrics (to record call statistics and count how many books require ISBN)
  • Health (to monitor health of the Number API)
  • REST Client (to call Book API with a standalone client)

Libraries and Infra

The project uses Quarkus as the Java stack, and the built in SmallRye components.

The required infrastructure provided by either Docker or Kubernetes includes:

  • Postgres Database
  • Kafka
  • Jaeger
  • Prometheus

Build

Set up a local Docker Registry first to store the generated Docker images:

docker run -d -p 5000:5000 --restart=always --name docker-registry registry:2

Use Maven to build the project with the following command from the project root:

mvn verify -Dquarkus.container-image.build=true

Run

With Docker

The easiest way to run the entire system is to use docker-compose. This will run the apps, plus all the required infrastructure. Run the following command from the project root:

docker-compose up

Use the following command to stop and remove all the containers:

docker-compose down

With Java

The infrastructure is still required to run the applications properly. They can also be set up manually in the running host, or use docker-compose to start only the required infrastructure:

docker-compose up database zookeeper kafka prometheus jaeger

To execute number-api and book-api directly, run the following command from each module root:

java -jar target/number-api-runner.jar

java -jar target/book-api-runner.jar

With Kubernetes

The infrastructure to run in Kubernetes is available in the .kubernetes folder. To start the infrastructure run:

kubectl apply -f .kubernetes

Quarkus is able to generate the Kubernetes deployment files and deploy the application directly. This requires a Maven build to generate the deployment descriptors:

mvn verify -Dquarkus.container-image.build=true -Dquarkus.kubernetes.deploy=true

Test the Applications

Use Swagger-UI to access the applications REST endpoint and invoke the APIs:

For Authentication and Authorization in book-api you need to call Authorize in the Swagger interface to generate a JWT. Any client_id, and client_secret is acceptable.

To check Metris and Tracing information:

Native Images

Install GraalVM Native Image binary with:

gu install native-image

Set up an environment variable GRAALVM_HOME pointing to the GraalVM installation folder.

mvn package -Pnative

This is going to generate a binary executable for each module. To execute number-api and book-api as native, run the following command from each module root:

./target/number-api-runner

./target/book-apo-runner

Build Native Docker Images

To build Docker Images with the native binaries run the following command:

mvn verify -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true

Or to deploy it directly to Kubernetes:

mvn verify -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true -Dquarkus.kubernetes.deploy=true

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].