Skip to content

genadigeno/accident-event-stream

Repository files navigation

Accident Management Service(AMS)

Project Description

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.

Visual

alt text

Application Description

Event stream application reads and distributes the incoming accident events to specific sink topics in real-time,
such are emergency.events, police.events, fire-rescue.evens and so on... If some error arises event stream
application sends it to dead letter topic(in case of default settings: accident.events-dlt) with valuable additional
information and continues process for other ones. That provides possibility of monitoring of the corrupted events for an
event source application. Distribution mechanism depends on an accident type, for example if the accident type is
criminal it will be sent to emergency and police services, however if it is fire accident then - police, emergency and
fire-rescue service.

Visual

Accident Event Stream application architecture

alt text

Getting started

Installation requirements

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

Installation steps

The project installation could be done using docker-compose.yml via command line interface (CMD):

git clone https://gitlab.com/genadigeno/accident-event-stream.git ams-event-stream &&
cd ams-event-stream &&
docker compose up

or

git clone https://gitlab.com/genadigeno/accident-event-stream.git ams-event-stream &&
cd ams-event-stream &&
mvn clean package &&
java -jar ./target/accident-event-stream.jar

JVM Parameters

  • SERVER_PORT - application port number, default: 8080
  • FIRE_RESCUE_SERVICE_TOPIC_NAME - kafka topic name for fire-rescue service, default: fire-rescue.events
  • STATISTICS_SERVICE_TOPIC_NAME - kafka topic name for statistics service, default: statistics.events
  • POLICE_SERVICE_TOPIC_NAME - kafka topic name for police service, default: police.events
  • EMERGENCY_SERVICE_TOPIC_NAME - kafka topic name for emergency service, default: emergency.events
  • SOURCE_TOPIC_NAME - kafka source topic name for event stream application, default: accident.events
  • DLT_SOURCE_TOPIC_NAME - kafka dead letter topic name for event stream application, default: accident.events-dlt
  • BOOTSTRAP_SERVERS - kafka cluster url, default: localhost:9092,localhost:9093
  • SCHEMA_REGISTRY_URL - schema registry url, default: http://localhost:8081
  • AVRO_SUBJECT_VERSION - subject version of avro serde, default: latest
  • CACHE_MAX_SIZE_BUFFERING - buffer size of statefull operations, default: 0
  • STATE_DIRECTORY - state store directory, default: ./state-dir

Example java -DSERVER_PORT=9898 -DBOOTSTRAP_SERVERS=localhost:9092 -jar ./target/accident-event-stream.jar


Used Technologies

  • img Event-Driven Architecture
  • img Java 17
  • img Spring Boot & Spring Boot JPA
  • img Apache Kafka & Kafka Streams library
  • img Docker
  • img Git
  • img Gitlab CI/CD

Project status

Completed


img

Klicka här för att läsa beskrivningen på svenska

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published