2.5 Olive Micro-service Framework

5 minute read

Micro-service Framework Olive

The Olive Micro-service framework is a component that allows for the definition of micro-services via configuration and manages their lifecycle. This component is designed in order to be used as the main interface to connect the Olive CMS and the ADOxx platform with the external world.

Olive Microservice Framework Components Architecture: Olive_Framework_Architecture

The framework is composed of two main components: The Micro-service Controller and the Connector Controller. Both are available in the same project package and exposed with Java APIs. Another supporting package is available in order to provide REST APIs (including a web management UI), over the main JAVA APIs. The Micro-service Controller component allows for the creation of micro-service instances starting from a definition JSON file and manages their lifecycle, including the starting, stopping calling and deleting phases. Internally, it uses the Connector Controller component in order to perform its expected operations. The Connector Controller component is responsible to perform the effective micro-service operations invocating the proper operation engine. The component includes an extensible set of connectors that allow for the interaction with external systems in a standard and configurable way. Examples of connectors are the SQL Connector that allows to connect and perform queries to an SQL database, the REST connector that allows the invocation of another services exposed via REST interfaces or JavaScript engine connector that allows to execute arbitrary Javascript code in a secure environment. The example proposed since now refers to the category of synchronous connectors. The component is also able to manage asynchronous connectors like the JMS message bus connector that allows a micro-service to publish and subscribe to a bus channel and perform operations only in case of specific events. Supporting these two main components, there are some utilities components used only internally to provide logging features, monitoring of system behaviours and persistence of micro-service definition files.

In the following, the instructions to download and deploy the framework are provided.

The framework is provided in two different packages; one involving the Java library providing all the framework features and API, and another one that provides the REST interface that exploit the Java API in order to provide the same features over the REST protocol. In order to build and deploy both the packages, a basic knowledge of Git, Maven and Java is required.

In the following the instructions in details:

  1. Clone locally the Git repository containing the Java API, available at https://git.boc-group.eu/adoxx/microservice-controller (credentials required. Ask faq@adoxx.org for support).
  2. Compile the WAR file using the maven command in the project folder: maven install
  3. Deploy the WAR file in a Tomcat webapp folder.
  4. Clone locally the Git repository containing the REST API available at https://git.boc-group.eu/adoxx/microservice-controller-rest (credentials required. Ask faq@adoxx.org for support).
  5. Compile the WAR file using the maven command in the project folder: maven install
  6. Deploy the WAR file in a Tomcat webapp folder.
  7. Update the paths in the configuration file config.json under micro-service-controller-rest\src\main\resources\org\adoxx\microservice\api\rest

The required configuration keys are:

  • microservicesDefinitionFolder: Containing the folder where to store the micro-services JSON configuration files.
  • uploadFolder: Containing the folder where to store the uploaded files.
  • logFileName : Containing the path of the log file.
  • autostartEnabled: When true, all the micro-services that have an autostart property enabled will start at runtime.

Once deployed the management web interface will be available at http://your_domain/micro-service-controller-rest/.

Information

Usage

Extend

Updated: