go-benchmark-kafka-api

command module
v0.0.0-...-9210fbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2020 License: MIT Imports: 5 Imported by: 0

README

go-benchmark-kafka-api

The purpose of this repository is to do a performance benchmark for Kafka Producer in GoLang via REST API.

Results

With a NodeJS producer, this repository was able to produce 10,000 messages in 26.4 seconds. If you are able to benchmark it with another tool like CLI or JMeter then kindly share the results.

PRs are always welcome for benchmarking and improving the code.

Getting started

First of all you need Go and Kafka to be installed on your local machine. Before you start make sure you have Kafka running on your local machine. The next step would be to clone the repository and run the following commands within the go-benchmark-kafka-api repository.

go build main.go
./main

Now to call the API you can use any tool right from JMeter or write down your own script in any language. A simple curl command to invoke this API is as follows

curl --location --request POST 'http://localhost:1234/produce' \
--header 'Content-Type: application/json' \
--data-raw '{
	"topic": "test_topic",
	"message": "Man what up!"
}'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL