Skip to content

A Reactive and Event-Driven REST API of a CRUD of a backend session. Native Support with Quarkus.

License

Notifications You must be signed in to change notification settings

margostino/supersonic-session

Repository files navigation

Supersonic Session (SUSE)

Proof of Concept

This project is an attempt to build a generic REST API with a CRUD of backend session and explores a reactive and event-driven stack. This is just an experiment. The first version is based on a Generic Task Demo Service.

Tech Stack

The project uses Quarkus to build the CRUD API Rest service for (reduced and lightweight version) a backend/server session handling. The data persistance relies on DynamoDB. For reactive programming support it uses Vertx and Smallrye. The architecture follows the MicroProfile specification for building microservices and deliver portable applications across multiple runtimes. As an Event-Driven Backbone the project uses Kafka.

Requirements:

  • Java 11
  • Docker
  • Gradle
  • GraalVM 20

Local Development

How to run SUSE locally

  • Spin up dependencies: make docker.run.dependencies: Kafka + DynamoDB
  • Run SUSE ./gradlew quarkusDev
  • The folder postman includes the CRUD requests to test.

The default profile is dev

Build Native

  • Set quarkus.package.type:native in application configuration
  • Build the application: ./gradlew quarkusBuild
  • Grab a coffee and wait :)
  • Build the docker image: docker build -f src/main/docker/Dockerfile.native -t suse/suse .
  • Run the docker container: docker run -i --rm -p 8080:8080 suse/suse

Build (fast) JAR

  • Set quarkus.package.type:fast-jar in application configuration
  • Build the application: ./gradlew quarkusBuild (or ./gradlew quarkusBuild --fast-jar)
  • Build the docker image: docker build -f src/main/docker/Dockerfile.jvm -t suse/suse .
  • Run the docker container: docker run -i --rm -p 8080:8080 suse/suse

Build (uber) JAR

  • Set quarkus.package.type:uber-jar in application configuration
  • Build the application: ./gradlew quarkusBuild (or ./gradlew quarkusBuild --uber-jar)
  • Build the docker image: docker build -f src/main/docker/Dockerfile -t suse/suse .
  • Run the docker container: docker run -i --rm -p 8080:8080 suse/suse

Build (uber) JAR + Run SUSE as Docker Container

  • make docker.build
  • make docker.run.suse
  • curl http://localhost:8080/reactive/ping to check service is UP.

Metrics

Notes:

  • If you have environment variable KAFKA_BOOTSTRAP_SERVERS=some-ip:9092, it will take precedence.

What's next

  • Performance Benchmark
  • ETag header implementation for Optimistic Locking

Architecture

coming soon

How to run API tests

coming soon...