Connector tool based on scheduling.

Lukas Cerny 964ea7ac11 Fix Push to Senslog V1 6 gadi atpakaļ
config 964ea7ac11 Fix Push to Senslog V1 6 gadi atpakaļ
connector-app eade82a0e1 Configuration moved to 'app' module 6 gadi atpakaļ
connector-common 3c57539a77 Configuration for a centralized logging monitoring. 6 gadi atpakaļ
connector-fetch-api bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
connector-fetch-azure bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
connector-fetch-fieldclimate bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
connector-model bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
connector-push-api bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
connector-push-rest-senslog-v1 964ea7ac11 Fix Push to Senslog V1 6 gadi atpakaļ
connector-push-rest-senslog-v2 bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
docker ef40738634 Update Dockerfile 6 gadi atpakaļ
example-json 461b1ad0af Architecture of connectors, created connector from Azure to Senslog1 6 gadi atpakaļ
.gitignore bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
README.md d75aec1828 Added README and help 6 gadi atpakaļ
docker-compose.yaml 3c57539a77 Configuration for a centralized logging monitoring. 6 gadi atpakaļ
pom.xml bdee915c50 Docker with build profiles, init of FieldClimate 6 gadi atpakaļ
run.sh 461b1ad0af Architecture of connectors, created connector from Azure to Senslog1 6 gadi atpakaļ

README.md

Docker

The docker container is based on the image zenika/alpine-maven:3-jdk8. Uses Java JDK 8 and Maven 3. Configuration is composed of docker-compose.yaml and Dockerfile.

Dockerfile

Fundamental configuration which is used as a base for all services. Contains several variables:


Accessible in compile time:

  • MAVEN_PROFILE: defines maven profile


Accessible in runtime:

  • APP_PARAMS: defines parameters for an application
  • DEBUG: defines if debugging will be enabled

Docker-compose

Configuration of services. This file contains configuration of each service where are defined build and runtime variables.

Name of service is fcs2 which is used for build and start the service. Build arguments contain definition of maven profile. Arguments variables defines in build section are accessible only during compile time. When the images is created, the variables can not be changed. Environment variables are located in environment section and can be changed after the build process. These variables are used to set configuration for the built. Debugging can be enabled to set DEBUG variable to true and publish the port 50005. Otherwise the debugging is disable.

docker-compose.yaml
services:
  fcs2:
    container_name: fieldclimateSenslog2
    build:
      dockerfile: Dockerfile
      context: .
      args:
         MAVEN_PROFILE: FieldClimateSenslog2
    ports:
      - "5005:5005"
    restart: always
    environment:
        APP_PARAMS: -cf config/test.yaml
        DEBUG: "true"

Build & run

To build all or a specific one service.

$ docker-compose build
$ docker-compose build <service_name>  // e.g. fcs2

To start all or a specific one service.

$ docker-compose up
$ docker-compose up <service>          // e.g. fcs2

Java & Maven

The application supports Java 8+ and uses Maven as a build automation tool. Configuration for Maven contains profiles which defines modules that will be compiled.

It is recommended to clean entire project before compilation.

$ mvn clean

To build all modules.

$ mvn package

To build only the modules which contains modules for the Azure LoraWan and the Senslog V1.

$ mvn package -P LoraWanSenslog1

All modules (JARs) are compiled to the bin folder. To be able to start the application, it is important to add all JARs to classpath and to define main class (java ).

$ java -cp "bin/*" cz.senslog.connector.app.Main <app_params>

Parameters

The application allows these parameters:

Usage: General Senslog Connector [options]
    Options:
      -cf, -config-file
        Configuration file in .yaml format.
      -h, -help