Module anatomy
A module is either a server application exposing a REST API, or a server application together with its user interface.
The interface can be written with React, Angular
or Qute templates. Interfaces built with React or Angular are
stored under src/main/resources/META-INF/resources.
Structure
module/
README.md
src/main/java
ModuleMain.java
ModuleVerticle.java
src/main/resources
application.properties
src/main/resources/META-INF/resources
(HTML and JavaScript bundle of the user interface)
How it runs
Each module starts a Quarkus application with an embedded web server, which exposes the REST API and any other entry point of the module. The default port differs from one module to the next, so that several can run side by side. See Module paths and ports.
Each module also starts a Vert.x verticle, which subscribes to the event bus. This is how modules exchange messages asynchronously.
Starting a module
A module starts like any Quarkus application:
mvn quarkus:dev
Packaging as a container
mvn package -Pjib
See Packaging for the other formats.
Configuration and environment variables
Every module has configuration files, and any setting can be overridden by an environment variable. Sources are read in this order of precedence, highest first:
- System properties, passed at startup as
-Dproperty=value. - Environment variables.
- Properties files:
application.properties, and the file of the active profile, such asapplication-dev.properties, whose values replace the common ones for that profile.
Custom configuration sources can be added; their position depends on the ordinal they declare.
The rules come from the MicroProfile Config specification.