-------------------------------------------------------------------- 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
| 1232 | // PLEASE NOTE that handlers are likely be called from several goroutines concurrently, |
| 1233 | // ensure that all state is safely protected against race conditions. |
| 1234 | type 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. |
| 1251 | type ConsumerGroupClaim interface { |
no outgoing calls
no test coverage detected