marcinciapa / actracker-search-feeder

0 stars 0 forks source link

Purpose of actracker-search-feeder

This application has been created with learning the following topics in mind:

Role of actracker-search-feeder in Actracker project

The role of this application is replicating Actracker bounded context into the Actracker search engine to run search and analytics query on them.

Architecture

The application runs as a Spring Boot container. The Actracker domain events are consumed from Equino RabbitMQ cluster. After the latest version of domain entity is saved in a database (PostgresSQL), an internal notification is sent back to RabbitMQ and the entity is indexed in Elasticsearch index.

Running locally

Setting up infrastructure

Locally setup infrastructure is required to run the application. The maven goal docker-compose:up should be run prior to application startup to ensure that all the required infrastructure components have been set up locally (docker and docker-compose needs to be installed):

./mvnw docker-compose:up

./mvnw docker-compose:down

Running application

To run the application locally ActrackerSearchFeederApplication must be run. It's a class starting the Spring Boot container. Alternatively, Maven Spring Boot plugin can be used:

./mvnw spring-boot:run

Postgres schema migration

Postgres schema is maintained by Flyway. Whenever the application starts, Flyway migration is running. After migration of Postgres schema, JOOQ code needs to be generated (see next bullet). Schema migration may also by run with Maven (for locally run database): ./mvnw flyway:migrate

JOOQ code generation

JOOQ code should be generated after migrating to new Postgres schema. To generate JOOQ code, run: ./mvnw jooq-codegen:generate.

Build pipelines

There are build pipelines defined in jenkins_files directory.

After the pull request is created, the PR pipeline is started in Equino Jenkins, which tests the PR and deploys the application to development environment.

When the build passes, the change may be deployed and merged by adding the 'ready for release' comment to the pull request. The comment triggers the Release pipeline. It deploys the application to production environment, merges the PR and deletes branch.

Merge of the PR triggers the Master pipeline. The pipeline updates version of the application using the equino-version Gradle plugin and deploys the application to integration environment.

Versioning and Gradle

The application version is maintained automatically with the equino-version Gradle plugin. The current version is passed to the POM using the versions-maven-plugin. Maintaining the version is the only purpose of Gradle being present in actracker-search-feeder repository. The build lifecycle is maintained using Maven.

Deployment

The application is deployed to Equino Kubernetes cluster from Jenkins pipelines. The deployment is handled by Maven jkube plugin.