This project is a POC on how to implement Kafka for tracking dependent activity between application.
- Download zip file from https://www.apache.org/dyn/closer.cgi?path=/kafka/2.1.0/kafka_2.11-2.1.0.tgz
- Extract zip & change directory location.
i) tar -xzf kafka_2.11-2.1.0.tgz
ii) cd kafka_2.11-2.1.0 - Start zookeeper by cmd bin/zookeeper-server-start.sh config/zookeeper.properties.
- Start kafka server using cmd bin/kafka-server-start.sh config/server.properties.
- Create topic using cmd bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic
- Send message to kafka using cmd bin/kafka-console-producer.sh --broker-list localhost:9092 --topic
- Consume message from Kafka using cmd bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic --from-beginning.
- Above mentioned steps refer to installing and testing kafka using CLI.
- For windows users refer kafka documentation.
I have used mongodb for persistence.
{ "eventList": [ { "noun": "server-config" "verb": "update", "eventId": "serverconfig", "timestamp": 1438791098, "data": { "id": 1, "user": { "id": 2, "name": "Admin" }, "comment": "this is an event" } }, { "noun": "server-config", "verb": "update", "eventId": "serverconfig", "timestamp": 1438791098, "data": { "id": 1, "user": { "id": 2, "name": "Admin" }, "comment": "this is an event" } } ] }