Skip to content

lg-labs/blank-service

Repository files navigation

๐Ÿ› ๏ธ Blank ฮผ-service with Hex Arch, DDD, SAGA, Outbox&Kafka

lg-labs License

๐Ÿ‘‹ Management the blank service for the blanksystem.

From Lg Pentagon or lg5! Get Lg5-Spring to develop ฮผ-services faster.

For more information, check this pages https://lufgarciaqu.medium.com.

โš ๏ธ Replace _blank_ with the Domain Name โš ๏ธ

For full documentation visit the Wiki.

Using Lg5 Spring 1.0.0-alpha, JDK 21

More details and Repository.

๐Ÿš€ Build project

Install 1/1: Setup JDK 21.

sdk use java 21.0.2-amzn 

Install 1/2: Install the dependencies in your project.

mvn clean install 

๐Ÿš€ Deploy with K8s

Use the infra repository blank-infra to deploy with K8s

๐Ÿ“šContents

๐Ÿš€ Run locally

You can ...

Using makefile

Start with infrastructure

๐Ÿ˜€ To start the Kafka Cluster and Postgres.

make docker-up

โ›”๏ธ To the Kafka Cluster and Postgres stop or destroy:

make docker-down

Run APP

๐Ÿ˜€ To start the blank Service.

make run-app

blank API 1.0.0-alpha

๐Ÿ‘‹ blank API, Port:8181

Username: None
Password: None

Database UI

๐Ÿ‘‹ PgAdmin, Port:5013

Username: blanksystem@db.com
Password: blanksystem-db

Kafka UI

๐Ÿ‘‹ Kafka UI, Port:9080

Username: None
Password: None

Contracts

  1. Open API
  2. Async API

AVRO MODELS from Avro Model definition

If you add a new Avro model, REMEMBER execute avro model again.

make run-avro-model

Logger & ELK

This project is prepared to send log files and process visualization with filebeat. You can specify the directory for stored the *.log files. Now, genera two file logs.

Simple log

  • [log.path]/[application_name]-simple.log

Complex log

  • [log.path]/[application_name]-complex.log
  • Specify the directory with log.path property.

Simple: Simple details about application logs. Complex: More details about application logs.

๐Ÿงช Testing Project

Sonar Results

โœ… Checkstyle 1/4: configuration that checks the Google coding conventions from Google Java Style.

make run-checkstyle 

๐Ÿงช Running Unit Test 2/4: Using JUnit 5.

make run-unit-test 

๐ŸŒพ Running Integration Test 3/4: Using Test Containers, JUnit 5 and Rest-Assured.

make run-integration-test 

๐Ÿฅ’Running Acceptance Test 4/4: Using Cucumber, Test Containers, JUnit 5 and Rest-Assured.

make run-acceptance-test

Interaction with tests one-to-one

๐Ÿงช Run a Unit Test

make run-ut-spec TEST_NAME=BlankMessageListenerImplTest

Details: make run-ut-spec TEST_NAME=[TestNameTest]

๐ŸŒพRun an Integration Test

make run-it-spec TEST_NAME=OtherRepositoryIT

Details: make run-it-spec TEST_NAME=[TestNameTest|TestNameIT]

๐Ÿฅ’ Run an Acceptance Test

make run-at-spec TEST_NAME=AcceptanceTestCase

Details: make run-at-spec TEST_NAME=[TestNameAcceptanceT]

โš ๏ธ Any Test: Be careful, this option is slower.

make run-test-spec TEST_NAME=BlankMessageListenerImplTest

Details: make run-test-spec TEST_NAME=[TestNameTest|TestNameIT|TestNameAcceptanceT]

You can show the Acceptance Test Report Online.

Problems?

Kafka connection refused or message no produced

If you have problems with Kafka connection refused or message no produced, you can check the following:

  1. Check if the Kafka container is running.
  2. Check the application.properties file for the correct Kafka bootstrap servers.
  3. Check the network configuration of the Docker containers.
  4. Check the application logs for any errors related to Kafka.
logging:
  level:
    org.apache.kafka: DEBUG

โš–๏ธ License

The MIT License (MIT). Please see License for more information.

Releases

No releases published

Packages

 
 
 

Contributors