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.
- 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.
Below are the API references used in the demo that are exposed on port 8080.
GET /api/person?name={name}
GET /api/history
GET /api/history?name={name}
GET /q/health
GET /q/health/live
GET /q/health/ready
The APIs can also be tested using the interactive swagger documentation located at localhost:8080/q/swagger-ui
.
You can run the application in dev mode that enables live coding using:
./mvnw quarkus:dev
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
.
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.
Many commonly asked questions are answered in the FAQ: https://github.com/StevenJDH/quarkus-surmiser-app/wiki/FAQ
Method | Address |
---|---|
PayPal: | https://www.paypal.me/stevenjdh |
Cryptocurrency: | Supported options |
// Steven Jenkins De Haro ("StevenJDH" on GitHub)