# graalvm-microprofile **Repository Path**: mirrors_tomitribe/graalvm-microprofile ## Basic Information - **Project Name**: graalvm-microprofile - **Description**: Demo for creating a polyglot solution on GraalVM compatible with MicroProfile. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README = GraalVM with MicroProfile This is the codebase with all the demos for the presentation GraalVM and MicroProfile: A Polyglot Microservices Solution. == Samples Structure * libraries (a fat jar with all the microprofile required implementations to use with GraalVM) * number-api (a microservice endpoint in Node that generate an id number) == Running the Samples === Setup GraalVM Please refer to the https://www.graalvm.org/docs/getting-started/#install-graalvm[GraalVM Installation Guide]. These samples were tested with Graal VM version 19.1.x. ==== Install Ruby * Install the `ruby` language in GraalVM with `gu install ruby`. * Rebuild the `ruby` language in GraalVM with `gu rebuild-images ruby`. ==== Install Python * Install the `python` language in GraalVM with `gu install python`. * Rebuild the `python` language in GraalVM with `gu rebuild-images python`. === Prepare Go to the `libraries` folder and run `mvn clean install`. This will build the fat jar with all the required microprofile dependencies to use with other languages. [NOTE] ==== When running node or ruby commands, make sure that you use the the binaries from the bin folder inside GraalVM. ==== === Number API ==== Run number-api with Node * Install the required node modules with `npm install left-pad express`. * Run the microservice with `node --jvm --vm.cp=../libraries/target/microprofile.jar --vm.DNUMBER_API_PORT=5001 number-api.js`. ==== Run number-api with Ruby * Install Ruby Sinatra with `gem install sinatra`. * Run the microservice with `ruby --jvm --vm.cp=../libraries/target/microprofile.jar --vm.DNUMBER_API_PORT=5002 number-api.rb`. ==== Run number-api with Java * Build the code with `mvn clean install`. * Build a native image with `native-image --no-server --no-fallback --report-unsupported-elements-at-runtime --initialize-at-build-time -H:+ReportExceptionStackTraces -H:+ReportUnsupportedElementsAtRuntime -H:ConfigurationFileDirectories=conf/ -jar target/number-api.jar` * Run `./number-api`. === Number API Invoker ==== Build number-api-client Go to the `number-api-client` folder and run `mvn clean install`. This will build the jar with the client code to call the number api resource. ==== Run number-api-invoker with Ruby * Run the client invoker with `ruby --jvm --vm.cp=../number-api-client/target/number-api-client.jar:../libraries/target/microprofile.jar --vm.Dorg.tomitribe.graalvm.microprofile.number.api.client.NumberResourceClient/mp-rest/url=http://localhost:5001/number-api/ number-api-invoker.rb` ==== Run number-api-invoker with Python * Run the client invoker with `graalpython --jvm --vm.cp=../number-api-client/target/number-api-client.jar:../libraries/target/microprofile.jar --vm.Dorg.tomitribe.graalvm.microprofile.number.api.client.NumberResourceClient/mp-rest/url=http://localhost:5001/number-api/ number-api-invoker.py` == Other === Debug GraalVM * Add `--jvm.agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005` in the GraalVM command.