A core Kafka library for Go, providing reliable messaging primitives and stream-processing foundations.
- Consumer Group
// Avro schema registry configurations.
// Need to register new schemas here.
sr := avro.NewCachedSchemaRegistry([]string{"foobar"}, 1)
// Kafka configurations
cfg := keystone.Config{
Brokers: []string{"localhost:9092"},
Group: "sampleConsumer",
Version: keystone.Version_2_1_1,
Topics: []string{"foobar"},
BalanceStrategy: keystone.RoundRobin,
Offset: keystone.Oldest,
ConsumerCallback: Callback,
Decoder: keystone.GetDefaultDecoder(),
EncoderBuilder: keystone.DefaultEncoderBuilder(),
}
cg := keystone.NewConsumerGroup(cfg)// Function is called when message recieved.
func Callback(key interface{}, value interface{}) (err error) {
return nil
}