Demo app for MicroProfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
membership Added Martin's presentation link Jan 27, 2019
profiling
staticweb Added Martin's presentation link Jan 27, 2019
user
.gitignore
.maven.xml Added travis build Jan 25, 2019
.travis.yml
LICENSE Initial commit Apr 26, 2018
README.md
bulkhead_load_test.jmx Done ! (v1) Jul 7, 2018
docker-compose.yml Add docker and docker-compose setup Jan 18, 2019
grafana.json Fix references to red and yellow pi in grafana.json Jan 27, 2019
high_level.png Update high level image Oct 18, 2018
microprofile-logo.png Added images Jul 7, 2018
microprofile-spec-1.3.pdf
openliberty.png Added images Jul 7, 2018
payara.jpeg
pom.xml Added Martin's presentation link Jan 27, 2019
prometheus.yml Moved to work on localhost Sep 15, 2018
sample.gif
thorntail.png README Update Oct 12, 2018

README.md

Microprofile demo


Build Status Maven Central License

logo

Presentations

If anyone is looking for a talk to give at your local meetups or conferences you are welcome to use all or parts of this demo and presentation. You can make it your own or use it as is. You are also welcome to improve the talk and demo and contribute back. (reference)

Known presentations

Implementations

The demo runs on

thorntail

payara

openliberty

Dependencies

This demo use microprofile-extentions extensively.

High level use case

highlevel

Getting started.

Prerequisite

To make the example easier we use an internal H2 Database and internal Elasticsearch server, so no need to install any datastore.

You can, however, use MySQL if you prefer:

MySQL / Maria (Optional)

You need a MySQL/Maria Database installed and running on your PC.

So something like this:

sudo pacman -S mariadb
sudo systemctl start mariadb.service

You need to create a Database and Database User in Maria:

mysql -u root -p < membership/init.sql

You also need to change the datasource definition in web.xml and change the driver in pom.xml

Prometheus and Grafana (Optional)

To see the metrics in action (i.e. more than just the raw output) you will need a Prometheus and Grafana server.

So something like this:

packer -S prometheus
sudo pacman -Ss grafana
sudo systemctl start prometheus.service
sudo systemctl start grafana.service

Also make sure prometheus is configured in

/etc/prometheus/prometheus.yml

(look at prometheus.yml as an example. You can also use the grafana.json for the grafana dashboards)

Source code

The then demo code on your PC:

git clone https://github.com/phillip-kruger/microprofile-demo.git
cd microprofile-demo
mvn clean install

Running

Manually

Build and start Membership service

cd membership/
mvn clean install -Prun

Build and start Profiling service

cd profiling/
mvn clean install -Prun

Build and start User service

cd user/
mvn clean install -Prun

Docker compose

Alternatively you can use docker and docker compose to run the whole project in a single command:

mvn clean install
docker-compose up --build

Static Web Demo page

There is a static HTML Demo page, you can go to any of

You can generate a token in the User Service to be used in the other services.

You can find some test users in the OpenLiberty configuration - server.xml

Sample

sample