kafkautil

package module
v0.0.0-...-7e6d3d0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 9 Imported by: 12

README

kafkautil GoDoc

This repo holds several utilities that can be useful if you use Go and Goka for stream processing with Apache Kafka on Confluent Platform.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MurmurHasher

func MurmurHasher() hash.Hash32

MurmurHasher creates murmur2 hasher implementing hash.Hash32 interface. The implementation is not full and does not support streaming. It only implements the interface to comply with sarama.NewCustomHashPartitioner signature. But Sarama only uses Write method once, when writing keys and values of the message, so streaming support is not necessary.

func NewJVMCompatiblePartitioner

func NewJVMCompatiblePartitioner(topic string) sarama.Partitioner

NewJVMCompatiblePartitioner creates a Sarama partitioner that uses the same hashing algorithm as JVM Kafka clients.

Types

type CodecWrapper

type CodecWrapper interface {
	WrapCodec(c goka.Codec, subject string) goka.Codec
}

CodecWrapper wraps Avro goka.Codec to be compatible with Confluent Schema registry wire format.

func NewCodecWrapper

func NewCodecWrapper(rc schemaRegisterer) CodecWrapper

NewCodecWrapper creates new CodecWrapper using provided Schema Registry client.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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