{"id":18888159,"url":"https://github.com/consol/jugm-quarkus","last_synced_at":"2026-02-24T12:30:16.636Z","repository":{"id":72844615,"uuid":"265289458","full_name":"ConSol/jugm-quarkus","owner":"ConSol","description":"Sample code for JUG Munich quarkus talk on 2020-05-27","archived":false,"fork":false,"pushed_at":"2020-05-27T13:38:52.000Z","size":507,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-31T05:28:57.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConSol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-19T15:40:48.000Z","updated_at":"2020-09-14T03:44:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"c658ee92-170a-4aa6-9fc3-7e5aa8fb248d","html_url":"https://github.com/ConSol/jugm-quarkus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConSol%2Fjugm-quarkus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConSol%2Fjugm-quarkus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConSol%2Fjugm-quarkus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConSol%2Fjugm-quarkus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConSol","download_url":"https://codeload.github.com/ConSol/jugm-quarkus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859562,"owners_count":19708863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T07:42:32.900Z","updated_at":"2026-02-24T12:30:16.580Z","avatar_url":"https://github.com/ConSol.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo Code for the [JUG Munich][jugm] Talk \"GraalVM und Quarkus: von heiligen Relikten und subatomaren Partikeln\" held on 2020-05-27\n\nThe code serves as a basis to play around with different features and as code sample for\nbootstrapping own projects.\n\n## Prerequisites\n\nThe dependent systems (DBMS-system, OAuth2-provider, Jaeger) are started through docker, thus a\nworking docker installation is needed.\n\nIn order to build and execute the application, ja JDK \u003e= 11 must be installed. Furthermore, for\nnative compilation, [GraalVM][GraalVM] and the [native image feature][GraalVMNative]. Compilation\nhas been tested with GraalVM version 20.0.0 and version 20.1.0.\n\n## The environment\n\nThe environment consists of:\n\n- A dbms service: This is a postgres docker container with two databases:\n  - one for the keycloak (name: `keycloak`, username `keycloak`, password `keycloak`)\n  - one for the application (name: `app_user`, username `app_user`, password `app_user`)\n  The database is accessible through local port 15432.\n- An OAuth2 service: This is a keycloak docker container. The container is configured to load a\n  suiting realm (located in `localdeployment/keycloak/app.json`) and connect to the DBMS service to\n  persist its data. When started (takes about 30 seconds), it is accessible through\n  [`http://localhost:8090`][LocalKeycloak].\n  - username: `keycloak`\n  - password: `keycloak`\n- A tracing service: This is an all-in-one Jaeger container. It exposes port `14268` for trace\n  collecting and port `16686` for the Web-UI. When started, the Web-UI is accessible at\n  [`http://localhost:16686`][LocalJaeger].\n\n## Deploying dependencies in docker\n\nTo deploy the dependent services, execute\n\n    localdeployment/deploy.[cmd|sh]\n\nIf you with to also initialize the database for the application with a schema, execute\n\n    localdeployment/migrate-database-and-deploy.[cmd|sh]\n\n## Building and starting the application\n\nThe application uses maven wrappers, so no further installation is required to build it. Execute\n\n    ./mvnw clean package\n\nto build the application. This will generate a file `target/jugm-quarkus-0.0.1-SNAPSHOT-runner.jar`,\nwhich can be executed directly to start the application:\n\n    cd target\n    java -jar jugm-quarkus-0.0.1-SNAPSHOT-runner.jar\n\nThe application is then accessible through [`http://localhost:8080`][LocalApp]\n\n## What it does\n\nThe app provides two general domains by exposing a REST API:\n\n- creating, querying and deleting users: This is done through the endpoint `/users`. We give some\n  example commands to interact with the REST API.\n  - `POST`ing a new user:\n    ``` bash\n    curl --location --request POST 'localhost:8080/users' \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{\n      \"name\": \"John Doe\",\n      \"email\": \"john@doe.com\"\n    }'\n    ```\n  - `GET`ting a single user by name:\n    ``` bash\n    curl --location --request GET 'http://localhost:8080/users/John%20Doe'\n    ```\n  - `GET`ting all users: In order to get all users, we first need to obtain a token from the\n    keycloak server:\n    ``` bash\n    export TOKEN=$(curl --location --request POST 'http://localhost:8090/auth/realms/app/protocol/openid-connect/token' \\\n    --header 'Content-Type: application/x-www-form-urlencoded' \\\n    --data-urlencode 'client_id=app-client' \\\n    --data-urlencode 'client_secret=31a859f6-95f5-4f32-8403-0b2a3f36969e' \\\n    --data-urlencode 'grant_type=password' \\\n    --data-urlencode 'username=adminUser' \\\n    --data-urlencode 'password=adminUser' \\\n    | jq '.access_token') \\\n    \u0026\u0026 TOKEN=$(sed -e 's/^\"//' -e 's/\"$//' \u003c\u003c\u003c\"$TOKEN\")\n    ```\n    With the token obtained, we can now make a request with this token to obtain a list of all\n    users:\n    ``` bash\n    curl --request GET 'http://localhost:8080/users' --header \"Authorization: Bearer $TOKEN\"\n    ```\n  - `DELETE`ing a user:\n    ``` bash\n    curl --location --request DELETE 'http://localhost:8080/users/john Doe'\n    ```\n- Querying an (external) REST-Service: The endpoint `fruits/{name}` will query the external REST\n  service [`http://www.fruityvice.com/`][FruityVice] for fruit information.\n  ```\n  curl --location --request GET 'http://localhost:8080/fruits/apple'\n  ```\n\nAside from this, the application provides the following technical endpoints:\n\n- [`/health`][LocalHealth]: showing the overall health status of the application.\n- [`/health/ready`][LocalReady], [`health/live`][LocalLive]: showing readiness and liveness of the\n  application.\n- [`/metrics`][LocalMetrics]: showing all metrics of the application.\n- [`/metrics/application`][LocalMetricsApp]: showing all application-specific metrics.\n- `/metrics/application/{name}` (e.g. \n  [`/metrics/application/de.consol.dus.boundary.endpoints.UserResource.allUsersTimer`][LocalMetricTimer]):\n  showing only the metrics to the specified name.\n\n## Tracing with Jaeger\n\nAfter making some request against the application, we can trace the requests by accessing the\n[Jaeger Web-UI][LocalJaeger].\n\n## Cleanup\n\nWhen we are done playing around with the application, we can shut down all started docker\ncontainers by executing\n\n    target/destroy.[cmd|sh]\n\n## Native compilation\n\nThe native compilation can also be done through maven by executing\n\n    ./mvnw -Pnative clean package\n\n---\nAttention:\n\nNative compilation is extremely memory-intensive. The process can use well beyond 10 GB of RAM. If\nthe OS starts swapping, the compilation may result in a system freeze.\n\n---\n\nThis will generate an executable `target/jugm-quarkus-0.0.1-SNAPSHOT-runner`. Starting this\nexecutable will result in the same behaviour as starting the jar-file.\n\n[jugm]: https://www.jugm.de/\n[GraalVM]: https://www.graalvm.org/\n[GraalVMNative]: https://www.graalvm.org/docs/reference-manual/native-image/\n[LocalKeycloak]: http://localhost:8090\n[LocalJaeger]: http://localhost:16686\n[LocalApp]: http://localhost:8080\n[FruityVice]: http://www.fruityvice.com/\n[LocalHealth]: http://localhost:8080/health\n[LocalReady]: http://localhost:8080/health/ready\n[LocalLive]: http://localhost:8080/health/live\n[LocalMetrics]: http://localhost:8080/metrics\n[LocalMetricsApp]: http://localhost:8080/metrics/application\n[LocalMetricTimer]: http://localhost:8080/metrics/application/de.consol.dus.boundary.endpoints.UserResource.allUsersTimer","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsol%2Fjugm-quarkus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconsol%2Fjugm-quarkus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsol%2Fjugm-quarkus/lists"}