Accident Management Service(AMS) is the project implemented with Event-Driven Architectural approach
that provides messages distribution across several services based on their event type, ACCIDENT_TYPE
.
It is simulation of what happens when some kind of accident happens,
it can be criminal, car, fire or some kind of accident that are saved in some
(in case of default settings: accident.events
) source topic.
Police Service application reads and processes the incoming police events from specific sink topics
(in case of default settings: police.events
) produced by event stream application. If some error arises
the application sends it to dead letter topic(in case of default settings: police.events-dlt
) and continues process
for other ones. Since data processed successfully it will be stored in postgres SQL database.
In order to start up the application you need have installed:
- Docker on you machine
- git
or - Apache kafka cluster with at least three brokers
- git
- maven 3.9.x
- JDK-17
The project installation could be done using docker-compose.yml via command line interface (CMD):
git clone https://gitlab.com/genadigeno/police-service.git &&
cd police-service &&
docker compose up
or
git clone https://gitlab.com/genadigeno/police-service.git &&
cd police-service &&
mvn clean package
java -DPOSTGRES_URL=jdbc:postgresql://localhost:5432/postgres -DPOSTGRES_USER=postgres -DPOSTGRES_PASSWORD= -jar ./target/police-service.jar
SERVER_PORT
- application port number, default: 8080KAFKA_MAIN_TOPIC_NAME
- kafka topic name for police service, default: police.eventsKAFKA_DLT_TOPIC_NAME
- kafka dead letter topic name for police service application, default: police.events-dltKAFKA_BOOTSTRAP_SERVERS
- kafka cluster url, default: localhost:9092,localhost:9093KAFKA_SCHEMA_REGISTRY_URL
- schema registry url, default: http://localhost:8081POSTGRES_URL
- postgres url, default: jdbc:postgresql://localhost:5432/postgresPOSTGRES_USER
- postgres user, default: postgresPOSTGRES_PASSWORD
- postgres password
Event-Driven Architecture
Java 17
Spring Boot & Spring Boot JPA
Apache Kafka & Kafka Streams library
Docker
Git
Gitlab CI/CD
Completed