Skip to main content

Back end

Modules are Java applications built on Quarkus. REST endpoints are written with JAX-RS, and asynchronous communication uses Vert.x.

Frameworks​

FrameworkRole
QuarkusApplication framework designed for containers: fast startup and low memory use
JAX-RSThe Java standard for REST endpoints, with annotations such as @GET, @POST, @PUT and @DELETE
Vert.xReactive toolkit: non-blocking I/O, concurrent request handling and the event bus

REST endpoints​

A module exposes its services as JAX-RS resources, which browsers and other clients call over HTTP.

@Path("/api/items")
public class ItemResource {

@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getAllItems() {
// Logic to retrieve items
return Response.ok(items).build();
}

@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response addItem(Item item) {
// Logic to add item
return Response.status(Response.Status.CREATED).build();
}
}

Asynchronous communication​

Inside the platform, modules send and receive messages on the Vert.x event bus and run background work without blocking the calling thread.

@ApplicationScoped
public class ItemService {

@Inject
Vertx vertx;

public void sendMessage(String address, JsonObject message) {
vertx.eventBus().request(address, message, ar -> {
if (ar.succeeded()) {
// Handle successful response
} else {
// Handle failure
}
});
}
}

JAX-RS handles what comes in over HTTP; Vert.x handles what happens between modules. See Communication between modules.

MicroProfile​

Quarkus implements MicroProfile, a set of open specifications for Java microservices. Modules rely on these parts of it:

SpecificationUse
ConfigSettings that can be overridden without rebuilding
Fault ToleranceCircuit breakers, timeouts and retries
JWT PropagationCarrying the member's token between modules for authentication and authorization
MetricsPerformance metrics
OpenAPIDocumentation of the REST API
HealthHealth checks used by the orchestrator
REST ClientTyped clients for calling other REST services