Registry / messaging / shopify-sarama-v1

shopify-sarama-v1

JSON →
library1.20.1gogounverified

A pure Go client library for Apache Kafka, providing both high-level and low-level APIs for producing and consuming messages.

go get gopkg.in/Shopify/sarama.v1
INSTALL
IMPORT
SIG · SHOPIFY-SARAMA-V1
S
shopify-sarama-v1
messaginggov1.20.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sarama
gopkg.in/Shopify/sarama.v1

Sends a message to a Kafka topic using the synchronous producer.

package main import ( "fmt" "gopkg.in/Shopify/sarama.v1" ) func main() { config := sarama.NewConfig() producer, err := sarama.NewSyncProducer([]string{"localhost:9092"}, config) if err != nil { panic(err) } defer producer.Close() msg := &sarama.ProducerMessage{Topic: "test", Value: sarama.StringEncoder("hello")} partition, offset, err := producer.SendMessage(msg) if err != nil { panic(err) } fmt.Printf("Message sent to partition %d at offset %d\n", partition, offset) }
Debug
Known issues
gotchaConsumer group rebalancing is not supported; use external libraries like sarama-cluster for that.
fix
Use github.com/bsm/sarama-cluster for consumer group support.
affects: >=1.0.0
Upgrade
Version history
1.20.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
shopify-sarama-v1 — go get shopify-sarama-v1 · libregistry