Jolie Slicer is a command line tool to support the development of Jolie applications following the the Sliceable Monolith development methodology. This tool allows to run a sliceable monolith application locally in a single process (via the --run option) or to slice it into a set of services (with --slice) that can be deployed and run in a containerized environment, such as Docker.
The tool is available as a Docker image on github:
docker pull ghcr.io/jolie/slicer:latestand as a package on npm:
npm install -g @jolie/slicerUsage:
jolieslicer application.ol configuration.json [options]-
The entire microservices architecture is coded in a single Jolie file (
application.ol):- Services are parameterised by their deployment configuration (
configuration) - Input and Output ports are parameterized by their deployment location available under the path
configuration.ServiceName.locations
As an example:
service Gateway( configuration ) { inputPort ip { location: configuration.Gateway.locations[0] ... } outputPort CommandSide { location: configuration.CommandSide.locations[0] ... } main { ... } }
- Services are parameterised by their deployment configuration (
-
A configuration file (
configuration.json) describes the services in the architecture, their ports, and initialisation parameters:{ "Gateway": { "ports": [ 8080 ], "params": { ... } }, "CommandSide": { "ports": [ "internal" ], "params": { ... } }, ... }Services provide their functionality through one or more ports, each declared as either:
- Internal (
"internal") and accessible only by services in the same deployment; - External (e.g.,
8080) and accessible by external clients through a TCP socket.
Initialisation parameters for each service can be provided under
"params". - Internal (
-
The Jolie Slicer can now be used to either:
- Run the microservices architecture as a single executable:
jolieslicer application.ol configuration.json --run
- Slice the monolith into separate codebases and
jolieslicer application.ol configuration.json--slice output_directory
- Run the microservices architecture as a single executable:
See example/ for an example application and "Sliceable Monolith: Monolith First, Microservices Later" (Picotti et al. 2021) for details on the Sliceable Monolith methodology see .