Posts

Showing posts with the label kafka

Connect Kafka with Golang

Image
Introduction If you need to know the basics of Kafka , such as its key features, components, and advantages, I have an article covering that here . Please review it and follow the steps until you've completed the Kafka installation using Docker to proceed with the following sections. Connecting to Kafka with Golang Similar to the example in the article about connecting Kafka with NodeJS , this source code also includes two parts: initializing a producer to send messages to Kafka and using a consumer to subscribe to messages from a topic . I'll break down the code into smaller parts for better understanding. First, let's define the variable values. package main import ( "fmt" "github.com/confluentinc/confluent-kafka-go/kafka" ) var ( broker = "localhost:9092" groupId = "group-id" topic = "topic-name" ) - Here, the package ` github.com/confluentinc/confluent-kafka-go/kafka ` is used to connect to Kafk...

Using Kafka with Docker and NodeJS

Image
Introduction to Kafka Kafka is an open-source , distributed messaging system that functions on a publish/subscribe model. It is widely used by numerous large companies for high-performance , real-time data streaming. Developed by LinkedIn since 2011, Kafka has grown into the most popular distributed streaming platform. It can handle vast amounts of records with high efficiency. Advantages of Kafka Open-source : Freely available and continuously improved by a large community. High-throughput, high-frequency : Capable of processing large volumes of data across topics continuously. Automatic message storage : Allows for easy message retrieval and verification. Large user community : Offers extensive support and shared resources. Basic Concepts If you're new to Kafka and Message Queues, here are some key concepts to understand: Producer : Creates and sends data to the Kafka server, where data is sent as messages in byte array format. Consumer : One or more consumers subscribe to...