Registry / messaging / onsdigital-dp-kafka-v2

onsdigital-dp-kafka-v2

JSON →
library2.8.0gogounverified

A Go library for interacting with Apache Kafka, used by the Office for National Statistics.

go get github.com/ONSdigital/dp-kafka/v2
INSTALL
IMPORT
SIG · ONSDIGITAL-DP-KAFK
O
onsdigital-dp-kafka-v2
messaginggov2.8.0
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.

kafka
github.com/ONSdigital/dp-kafka/v2

Create a Kafka producer and send a message.

package main import ( "context" "log" "github.com/ONSdigital/dp-kafka/v2" ) func main() { ctx := context.Background() config := &kafka.Config{BrokerAddrs: []string{"localhost:9092"}} producer, err := kafka.NewProducer(ctx, config) if err != nil { log.Fatal(err) } defer producer.Close(ctx) producer.Send(ctx, "topic", []byte("message")) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.8.0latest 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
onsdigital-dp-kafka-v2 — go get onsdigital-dp-kafka-v2 · libregistry