Skip to main content

Posts

Showing posts with the label Apache Kafka

Spring Cloud Stream Using Kafka

Recently I've been digging in event-driven architectures for service communication. For demo followed broker approach instead of Feed approach, as broker approach has dedicated broker responsible for distributing the events to n number of subscribers. For demo we will use most popular open-source Kafka broker (https://kafka.apache.org). As spring (http://spring.io)  always makes life easy 😎, Spring-Cloud-Stream project by spring makes Kafka integration in your application very easy 👍 with few annotations. Spring Cloud Stream provides Binder implementations for  Kafka ,  Rabbit MQ ,  Redis , and  Gemfire . Note: Before we proceed make sure you have installed ZooKeeper and Kafka & both are running. Dependencies Add following dependencies to your POM for using KAFKA. Use Case: We will have One producer (demo-producer application) & two consumers (demo-consumer application & demo-consume1 application). Produc...

Apache Kafka, A distributed Streaming Platform

This blog will guide  1 - How to install Zookeeper on Linux/Mac. 2 - How to install Apache Kafka. 3 - Commands to produce and consume message on Kafka. Installation of ZooKeeper Download latest zoopkeeper from http://zookeeper.apache.org/releases.html. Create opt/sotware folder in user directory, It can be any directory. I have extracted zookeeper  in /Users/ketangote/opt/zookeeper. cd /Users/ketangote/opt/zookeeper/conf cp zoo_sample.cfg zoo.cfg Open zoo.cfg using nano or vi and update data folder location:   dataDir=/Users/ketangote/opt/zookeeper/data Start zookeeper commands: sh zkServer.sh start Once zookeeper is started, use below command for verification.            telnet localhost 2181 Stop ZoopKeeper server : shZKServer.sh stop Installation Of KAFKA Download latest Kafka https://www.apache.org/dyn/closer.cgi?path=/kafka/0.10.1.0/kafka_2.11-0.10.1.0.tgz...