{"id":15992669,"url":"https://github.com/pmlopes/openfaas-vertx-native-template","last_synced_at":"2026-04-30T10:32:15.342Z","repository":{"id":142726109,"uuid":"174535613","full_name":"pmlopes/openfaas-vertx-native-template","owner":"pmlopes","description":"A Vert.x serverless template for native functions","archived":false,"fork":false,"pushed_at":"2019-07-10T13:28:56.000Z","size":60,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T07:44:56.135Z","etag":null,"topics":["graalvm","native-image","openfaas","serverless","vertx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmlopes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-03-08T12:39:55.000Z","updated_at":"2019-07-10T13:28:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"985d87eb-2d3a-4f43-b208-57959da2a833","html_url":"https://github.com/pmlopes/openfaas-vertx-native-template","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/pmlopes%2Fopenfaas-vertx-native-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmlopes%2Fopenfaas-vertx-native-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmlopes%2Fopenfaas-vertx-native-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmlopes%2Fopenfaas-vertx-native-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmlopes","download_url":"https://codeload.github.com/pmlopes/openfaas-vertx-native-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247263341,"owners_count":20910392,"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":["graalvm","native-image","openfaas","serverless","vertx"],"created_at":"2024-10-08T06:40:32.015Z","updated_at":"2026-04-30T10:32:10.310Z","avatar_url":"https://github.com/pmlopes.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Template: openfaas-svm-template\n\nThe GraalVM SVM (Eclipse Vert.x native image) template uses maven as a build system.\n\nThe template makes use of the OpenFaaS incubator project [of-watchdog](https://github.com/openfaas-incubator/of-watchdog).\n\n### Structure\n\nThis a template showcasing the use of GraalVM/SubstrateVM and Eclipse Vert.x as a viable runtime for Serverless functions.\n\nFunctions are pure java `xyz.jetdrone.openfaas.vertx.OpenFaaS` implementations. The minimal function can be:\n\n```java\nimport io.vertx.ext.web.RoutingContext;\nimport xyz.jetdrone.openfaas.vertx.OpenFaaS;\n\npublic class MyFunction implements Lambda {\n  @Override\n  public void handle(RoutingContext ctx) {\n\t\tctx.response().end(\"Hi!\");\n\t}\n}\n```\n\nThe provided entrypoint will setup the required HTTP server and will handle all the upload parsing making it available on the\n`RoutingContext` of the function.\n\n### Trying the template\n\n```\n$ faas template pull https://github.com/pmlopes/openfaas-vertx-native-template\n$ faas new --lang vertx-native \u003cfn-name\u003e\n```\n\n### Building\n\nWhen working in development mode, the java application is build as usual:\n\n```\nmvn clean package\n```\n\nWhen going to OpenFAAS, the build is run inside a Docker container using the provided `Dockerfile`.\n\nThe Dockerfile performs the following actions:\n\n1. Builds the Java code\n2. Generates a native image from the fat jar\n3. Creates a new image and install OpenFAAS of-watchdog\n4. Copies the native image to the new container\n5. Configures the watchdog\n\nYou can also run the Dockerfile locally:\n\n```\ndocker build -t my-vertx-fn .\ndocker run --rm -p 8080:8080 my-vertx-fn\n```\n\nYou can observe instant startup times and low memory usage:\n\n```\nForking - vertx-fn []\n2018/09/06 17:54:31 Started logging stderr from function.\n2018/09/06 17:54:31 OperationalMode: http\n2018/09/06 17:54:31 Started logging stdout from function.\n2018/09/06 17:54:31 Writing lock file at: /tmp/.lock\n2018/09/06 17:54:31 stdout: OpenFaaS Vert.x listening on port: 8000\n```\n\n```\ndocker stats\nCONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS\ncbcb653158fe        priceless_volhard   0.70%               5.812MiB / 15.55GiB   0.05%               3.09kB / 0B         0B / 0B             10\n```\n\nRemember that the memory usage in this case accounts for both the vert.x application and the watchdog!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmlopes%2Fopenfaas-vertx-native-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmlopes%2Fopenfaas-vertx-native-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmlopes%2Fopenfaas-vertx-native-template/lists"}