Skip to content

tejas07/Activity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Activity

Introduction

This project is a POC on how to implement Kafka for tracking dependent activity between application.

Kafka Setup

  1. Download zip file from https://www.apache.org/dyn/closer.cgi?path=/kafka/2.1.0/kafka_2.11-2.1.0.tgz
  2. Extract zip & change directory location.
    i) tar -xzf kafka_2.11-2.1.0.tgz
    ii) cd kafka_2.11-2.1.0
  3. Start zookeeper by cmd bin/zookeeper-server-start.sh config/zookeeper.properties.
  4. Start kafka server using cmd bin/kafka-server-start.sh config/server.properties.
  5. Create topic using cmd bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic
  6. Send message to kafka using cmd bin/kafka-console-producer.sh --broker-list localhost:9092 --topic
  7. Consume message from Kafka using cmd bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic --from-beginning.
  8. Above mentioned steps refer to installing and testing kafka using CLI.
  9. For windows users refer kafka documentation.

DB

I have used mongodb for persistence.

For testing activity application you need to send message as a JSON format shown below:

{ "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" } } ] }

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages