MCPcopy
hub / github.com/IBM/sarama / ConsumerGroupHandler

Interface ConsumerGroupHandler

consumer_group.go:1234–1248  ·  consumer_group.go::ConsumerGroupHandler

-------------------------------------------------------------------- ConsumerGroupHandler instances are used to handle individual topic/partition claims. It also provides hooks for your consumer group session life-cycle and allow you to trigger logic before or after the consume loop(s). PLEASE NOTE

Source from the content-addressed store, hash-verified

1232// PLEASE NOTE that handlers are likely be called from several goroutines concurrently,
1233// ensure that all state is safely protected against race conditions.
1234type ConsumerGroupHandler interface {
1235 // Setup is run at the beginning of a new session, before ConsumeClaim.
1236 Setup(ConsumerGroupSession) error
1237
1238 // Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
1239 // but before the offsets are committed for the very last time.
1240 Cleanup(ConsumerGroupSession) error
1241
1242 // ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
1243 // Once the Messages() channel is closed, the Handler must finish its processing
1244 // loop and exit. Handlers should also return when ConsumerGroupSession.Context()
1245 // is done; Messages() alone can block while the partition consumer is retrying
1246 // (e.g. after a broker disconnect). See examples/consumergroup.
1247 ConsumeClaim(ConsumerGroupSession, ConsumerGroupClaim) error
1248}
1249
1250// ConsumerGroupClaim processes Kafka messages from a given topic and partition within a consumer group.
1251type ConsumerGroupClaim interface {

Callers 10

newConsumerGroupSessionFunction · 0.65
TestVersionMatrixFunction · 0.65
TestVersionMatrixLZ4Function · 0.65
TestVersionMatrixZstdFunction · 0.65
TestBrokerFetchFunction · 0.65
TestSASLOAuthBearerFunction · 0.65
TestSASLSCRAMSHAXXXFunction · 0.65
consumeMethod · 0.65

Implementers 9

messageHandlerfunctional_producer_test.go
exampleConsumerGroupHandlerconsumer_group_example_test.go
handlerconsumer_group_test.go
drainHandlerconsumer_group_test.go
causeHandlerconsumer_group_test.go
testFuncConsumerGroupMemberfunctional_consumer_group_test.go
Consumerexamples/consumergroup/main.go
Consumerexamples/consumer_load_aware/main.go
Consumerexamples/exactly_once/main.go

Calls

no outgoing calls

Tested by

no test coverage detected