Skip to content

A demo project built with MicroProfile – a service that returns random combination of an adjective and a noun.

Notifications You must be signed in to change notification settings

verovero7/microprofile-randomstrings

 
 

Repository files navigation

MicroProfile – RandomStrings

Introduction

This is a demo application built with MicroProfile and currently running setup to run on OpenLiberty. It will return a combination of a random adjective and a noun.

The generation of the executable jar file can be performed by issuing the following command:

mvn clean package

This will create an executable jar file `randomstrings.jar within the target maven folder. This can be started by executing the following command:

java -jar target/randomstrings.jar

To launch the test page, open your browser at the following URL

http://localhost:9080/index.html

See the website for more information on MicroProfile.

Config

Configuration of your application parameters (specification).

The example class RandomStringsSupplier shows you how to configure and define default values for variables.

Health

The health status can be used to determine if the 'computing node' needs to be discarded/restarted or not (specification).

The class ServiceHealthCheck contains an example of a custom check which can be integrated to health status checks of the instance. The index page contains a link to the status data.

Metrics

The Metrics exports Telemetric data in a uniform way of system and custom resources (specification).

The class RandomStringsController contains an example how you can measure the execution time of a request. The index page also contains a link to the metric page (with all metric info).

Open API

Exposes the information about your endpoints in the format of the OpenAPI v3 specification (docs).

The index page contains a link to the OpenAPI information of the available endpoints for this project.

Deploy to Google Cloud Run

Make sure to have a file named exactly Dockerfile in the root folder of the project. This is the one Google Cloud Build will be using.

gcloud builds submit --tag gcr.io/{your project name}/randomstrings gcloud run deploy --image gcr.io/{your project name}/randomstrings --platform managed

Author

Rustam Mehmandarov

About

A demo project built with MicroProfile – a service that returns random combination of an adjective and a noun.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 98.2%
  • HTML 1.4%
  • Dockerfile 0.4%