Skip to content

grvsahil/kafka-producer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka-producer

This application demonstrates a kafka producer. We are using Confluent Kafka library to implement a kafka producer.

Quickstart

You don't need to have kafka installed locally as this app is using docker to run kafka.

Steps:-

  1. Just clone this repository and run "docker compose up -d" to pull the required images and start kafka in docker container in detached mode.
  2. Run the application using "go run cmd/main.go"
  3. That's it the application is up and ready!

Description

We have used GIN web framework to implement REST API.

Currently it supports only one POST route "/entry" which takes JSON body for example { "name":"James Bond" "amount":10000 } and sends this data into a kafka topic named "payment".

Any application can consume from this topic if it has required information about the topic and kafka server.

This application also supports message retry mechanism, so if a message fails to get produced then it retries 3 times before throwing an error.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages