项目作者: StevenJDH

项目描述 :
A kubernetes cloud native microservice using Quarkus, the the Supersonic Subatomic Java Framework.
高级语言: Java
项目地址: git://github.com/StevenJDH/quarkus-surmiser-app.git
创建时间: 2020-07-02T09:16:33Z
项目社区:https://github.com/StevenJDH/quarkus-surmiser-app

开源协议:GNU General Public License v3.0

下载


Surmiser

build-test
Codacy Badge
Quality Gate Status
Maintainability Rating
Reliability Rating
Technical Debt
Sonar Violations (long format)
Security Rating
Vulnerabilities
Coverage
Lines of Code
Maintenance
GitHub

Surmiser was develop to demo the use of Quarkus, the Supersonic Subatomic Java Framework, to create a cloud native microservice that exposes a few APIs for testing. The app surmises about a person’s name to predict their gender, age, and nationality. The service is powered by Genderize.io, Agify.io, and Nationalize.io, which it uses to produce a determination based on the supplied name.

Buy me a coffee

Features

  • Third-party service consolidation using MicroProfiling.
  • In memory database with Hibernate for history persistent storage while testing.
  • Logging of requests using an HTTP interceptor.
  • Can be run in JVM mode, or it can be compiled to Native code (Linux, Windows, and macOS) for millisecond speeds with a low memory footprint.
  • Liveness and Readiness health checks with some being integrated automatically like for the DB.
  • Retry, circuit breaker, and fallback fault tolerance strategies using MicroProfiling.
  • Automated testing using REST-assured.
  • Automatic YAML generation for Kubernetes or containerized environments.

Endpoints

Below are the API references used in the demo that are exposed on port 8080.

  1. GET /api/person?name={name}
  2. GET /api/history
  3. GET /api/history?name={name}
  4. GET /q/health
  5. GET /q/health/live
  6. GET /q/health/ready

The APIs can also be tested using the interactive swagger documentation located at localhost:8080/q/swagger-ui.

Running the application in dev mode

You can run the application in dev mode that enables live coding using:

  1. ./mvnw quarkus:dev

Packaging and running the application

The application can be packaged using ./mvnw package.
It produces the surmiser-app-1.0-SNAPSHOT-runner.jar file in the /target directory.
Be aware that it’s not an über-jar as the dependencies are copied into the target/lib directory.

The application is now runnable using java -jar target/surmiser-app-1.0-SNAPSHOT-runner.jar.

Creating a native executable

You can create a native executable using: ./mvnw package -Pnative.

Or, if you don’t have GraalVM installed, you can run the native executable build in a container using: ./mvnw package -Pnative -Dquarkus.native.container-build=true.

You can then execute your native executable with: ./target/surmiser-app-1.0-SNAPSHOT-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image.

Do you have any questions?

Many commonly asked questions are answered in the FAQ:
https://github.com/StevenJDH/quarkus-surmiser-app/wiki/FAQ

Want to show your support?

Method Address
PayPal: https://www.paypal.me/stevenjdh
Cryptocurrency: Supported options

// Steven Jenkins De Haro (“StevenJDH” on GitHub)