Small single page application to test interractions and integration with the famous message broker Kafka.
The backend of the application runs a background thread that produce messages to the broker. The message are simply a randomized IP address in the address range of the local host with the ping time and wether it is reachable or not.
Typical message:
NetworkScan {
"ipAddress" : "0.0.0.0",
"pingTimeMilli" : 3,
"isReachable" : true,
"brokerPartitionId" : 0
}
These messages go to the network-scan
topic. There is also an error-scan
topic which contains all IP addresses that caused an error. This topic also contains purposely caused exceptions, just to test the system. These exceptions are of typeVolunteerChaosException
.
Also, just to have at least some ip addresses that are reachable (in order to test the frontend properly), one out of two address is marked as 'reachable'.
Spring-boot backend that uses the simplicity of spring-kafka to connect to the message broker.
Angular frontend. This is a single page applicaiton so nothing fancy and pretty self explanatory.
This app uses 3 kafka brokers with one zookeeper instance. There is not a lot of topic so there is no point in using more than one broker. However, the objective of this small project is to test setup and interraction with a kafka cluster. The docker-compose side of things for kafka was accomplished thanks to this conlfuentinc repo.
THe broker cluster is also available outside the docker network. The 3 brokers are assigned to
localhost:19092
, localhost:29092
and localhost:39092
. Just specify one of these as bootstrap-servers
and you should be able to use the kafka-console-producer and kafka-console-consumer.
Everything runs in a docker container. Just run the following command from project root:
docker-compose up -d