Skip to content

Latest commit

 

History

History
193 lines (167 loc) · 7.96 KB

README_EN.md

File metadata and controls

193 lines (167 loc) · 7.96 KB
last-commit time-with-code sonar-code-lines sonar-quality-gate-status ci

📖 Description


Microservice is a configuration service built on top of spring-cloud-config-server. JDBC Backend (database — PostgreSQL) is used to store service configurations. To work with creating/updating/deleting/getting configuration properties — REST interaction is provided:

METHOD PATH DESCRIPTION BODY PARAM RESPONSE
POST /api/configurations/page Getting a page with configuration properties SearchSettings - TableResult<PropertyReturnDto>
POST /api/configurations Creation of a new configuration property. If there is one already, there is a duplicate error PropertyDto refresh PropertyReturnDto
POST /api/configurations/batch Creation of a large number of new configurations. If there are already such ones - a duplicate error List<PropertyDto> refresh List<PropertyReturnDto>
GET /api/configurations/{propertyId} Search for a configuration property by its UUID identifier - - PropertyReturnDto
PUT /api/configurations Updating an existing configuration property. If there is no such thing, a new one is created PropertyDto refresh PropertyReturnDto
PUT /api/configurations/batch Updating a large number of pre-existing configuration properties. If there is no such thing, a new one is created List<PropertyDto> refresh List<PropertyReturnDto>
DELETE /api/configurations/batch Removing a large number of configuration properties SearchSettingsSimple refresh List<PropertyReturnDto>
DELETE /api/configurations/{propertyId} Deleting a configuration property by its UUID identifier - refresh PropertyReturnDto
POST /api/configurations/refresh/{destination} Sending a message to the target service to update its configuration properties - - -
POST /api/configurations/refresh Sending a message to services to update their configuration properties List<String> - -

❗ Requirements


  • JDK: 18 and higher;
  • Docker: postgres + kafka;

📋 Start-up instructions


All commands are executed in the console. For all actions, you can use the IDE, but who knows about it — and will do it, the instruction is not needed.

Clone Repository
  1. Create a folder: mkdir GitProjects (the folder name can be anything, but you will need to continue to use only it);
  2. Go to the folder: cd GitProjects;
  3. Cloning a repository: git clone https://github.com/HogwartsSchoolOfMagic/ConfigurationService.git;
  4. Go to the folder: cd ConfigurationService;
  5. Complete.
Build project

Inside the folder: ConfigurationService, you need to run the command: mvn clean install.

Database Setup

After cloning the repository — we should already be in the project folder.

  1. For docker to work, you need to install it first;
  2. To configure the database required for the application to work, go to the folder: cd docker\postgres;
  3. Run the .bat file with the command: postgres.bat. Default port: 5024.
Application launch

After building the application, execute the command: mvn spring-boot:run. Default port: 8888.

⚙ Includes functionality


  • Translation of configuration properties;
  • Setting up, connecting and working with the Postgres database;
  • Using LiquiBase to create a database structure.

🔨 Technology stack


  • Spring Boot: WEB, Data, Admin client;
  • Spring Cloud: Server, Eureka client;
  • Postgres;
  • LiquiBase;
  • Lombok;
  • Mapstruct;
  • Docker.

🎫 License


Apache License Version 2.0

Copyright ©2022, Vladislav [SmithyVL] Kuznetsov