xkafka

command module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 14 Imported by: 0

README

Examples of how to use the xkafka package to read and write messages to a Kafka topic using xkafka.Consumer and xkafka.Producer.

Running Kafka

Start a Kafka broker using the provided docker-compose.yml file:

$ docker-compose up -d

Scenarios

Sequential Consumer

This is the default behavior of the consumer. The consumer will process messages sequentially and commit the offset based on the auto.commit.interval.ms configuration.

go run *.go sequential

Async Consumer

Async mode is enabled by setting xkafka.Concurrency to a value greater than 1. The consumer will process messages using a pool of Go routines.

go run *.go async

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳