One Framework a Day keeps the Boredom Away: Vert-X Golo

Welcome to this new edition of One Framework a Day keeps the Boredom Away. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it's about Vert-x and Golo.

In each post of this series we'll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at Vert-x and Golo.

If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI Clever-Tools.

What is Vert-x?

Eclipse Vert.x is a tool-kit for building reactive applications on the JVM.

And when they write JVM, they mean it. You can use any JVM language. Beyond the polyglot statement, you will find out that it's also event driven and non blocking. Which means it's ready to scale and will use your hardware as much as possible. It's reactive. I invite you to read the Reactive Manifesto if you have no idea what it is. Vert-x is unopinionated and as such is a good fit for any kind of application or microservice. Here we will use it to build an API.

What is Golo

A lightweight dynamic language for the JVM.

You can install Golo with a standalone binary available on their website. It's important because today we will also look at how to create a Golo project from scrach instead of using an existing one. All of this is happening thanks to our CSO Philippe Charrière who previously blogged on this subject, check out his blog!

Create a Golo Project

In a terminal, type these commands:

golo new vertx.golo.demo --type maven
cd vertx.golo.demo

The Golo CLI has generated a Golo project:

├── pom.xml
├── src
│   └── main
│       └── golo
│           └── main.golo

To make sure you can compile the project, you have to update the pom.xml file: Change the Golo version by replacing




Add some dependencies and the bintray repository:








We are going to write a very simple Vert-x web application with Golo. For that, replace the content of /src/main/golo/main.golo with this:

module vertx.golo.demo

import io.vertx.core.Vertx
import io.vertx.core.http.HttpServer
import io.vertx.ext.web.Router
import io.vertx.ext.web.handler

import gololang.JSON

let vertx = Vertx.vertx()

function main = |args| {

  let server = vertx: createHttpServer()
  let router = Router.router(vertx)
  router: route(): handler(BodyHandler.create())

  let port =  Integer.parseInt(System.getenv(): get("PORT") orIfNull "8080")

  router: get("/"): handler(|context| {
    context: response(): putHeader("content-type", "text/html;charset=UTF-8")
    context: response(): end("<h1>Hello 🌍</h1>", "UTF-8")

  router: get("/hi"): handler(|context| {
    context: response(): putHeader("content-type", "application/json;charset=UTF-8")
    context: response(): end(JSON.stringify(DynamicObject(): message("Hi 😛")), "UTF-8")

  server: requestHandler(|httpRequest| -> router: accept(httpRequest)): listen(port)

  println("listening on " + port)

To test the application:

  • Built it with: mvn package
  • Run it with: mvn exec:java
  • Test your web application by opening http://localhost:8080 and http://localhost:8080/hi

If it works locally then you are ready for the next step. Set it up for Clever Cloud.


Clever Cloud can run any JVM code packaged as a .war or .jar. You can either checkout those files directly in your Github repository or have them built with Maven or Gradle. In this case it's a Maven build that generates a .jar file from some Golo code. So when we create the application we have to select maven as type: clever create --type maven vertx-golo-sample

The only configurable thing is the port of the server. It defaults to 8080 in the code. It's also the case for each application running on Clever Cloud as it is required. So nothing to change here, we are ready to deploy.


To make our Maven buikd work we need to state which build goal is needed and where is the .jar file to run. To do so create in your project directory a clevercloud directory with a jar.json file containing:

  "build": {
    "type": "maven",
    "goal": "package"
  "deploy": {
    "jarName": "target/vertx.golo.demo-0.0.1-SNAPSHOT-jar-with-dependencies.jar"

It configures your application to run mvn package then java -jar target/vertx.golo.demo-0.0.1-SNAPSHOT-jar-with-dependencies.jar.

The last step to deploy it is to initiate an empty git repository, add and commit your code, then deploy it:

git init
git add src/ pom.xml clevercloud/
git commit -m "first version"
clever deploy

What clever deploy does is pushing your code to a remote git branch that was created when you created the application in the setup step. Right now you should start seeing build logs in the console. If everything worked well run clever open. It will take you straight to your web application and display Hello 🌍!


À lire également

Up to €100,000 in funding to adopt Hyper Open X technologies

The Hyper Open X consortium, made up of sixteen major French cloud players, has launched anambitious call for projects designed to accelerate the adoption of open source technologies for cloud and edge computing.

Clever Cloud announces international growth strategy and the expansion of leadership team

Nantes, France - Clever Cloud, French creator of Platform as a Service (PaaS) hosting and deployment solutions, announced today its intention to expand internationally, with a particular focus on the African and South Asian markets.
Company Press

Materia KV: our easy-to-use serverless key-value database is available to all

Clever Cloud was born out of a desire to make life easier for developers, by providing them automation tools and interfaces, so that they can concentrate on their applications and sites.