...
To help get access to consumer state for txn producer, consumer will expose a new API for some of its internal states as an opaque struct. This is already done by KIP-429, and we just take the details some high level information here for convenience.
Code Block | ||
---|---|---|
| ||
ConsumerGroupMetadata { public String groupId(); public int generationId(); public String memberId(); public Optional<String> groupInstanceId(); } |
Thus producer could poll the metadata as it needs during normal processing.
A new generation.id field shall be added to the `TxnOffsetCommitRequest` request. In the meantime we also suggest to add memberAs we see, the metadata exposed contains member.id, group.instance.id and generation.id, which are essentially the identifiers we use in the normal offset commit protocol. Inside `TxnOffsetCommitRequest`, member.id and group.instance.id generation.id to the request to field shall be added to make the txn offset commit fencing consistent with normal offset fencing.
Code Block |
---|
TxnOffsetCommitRequest => TransactionalId GroupId ProducerId ProducerEpoch Offsets GenerationId TransactionalId => String GroupId => String ProducerId => int64 ProducerEpoch => int16 Offsets => Map<TopicPartition, CommittedOffset> GenerationId => int32 // NEW MemberId => String // NEW GroupInstanceId => String // NEW |
If one of the generation.id field is not matching group generationcorrectly on server side, the client will be fenced immediately. An edge case is defined as:
...