Shekharrajak commented on code in PR #22357:
URL: https://github.com/apache/kafka/pull/22357#discussion_r3293889044
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -1977,6 +2026,184 @@ public void handleResponse(AbstractResponse response) {
}
}
+ private TxnShareAcknowledgeHandler txnShareAcknowledgeHandler(
+ TransactionalRequestResult result,
+ Map<TopicIdPartition, List<AcknowledgementBatch>> acknowledgements,
+ ShareGroupMetadata groupMetadata) {
+ pendingTxnShareAcks.putAll(acknowledgements);
+
+ List<TxnShareAcknowledgeTopic> topics = new ArrayList<>();
+ Map<String, TxnShareAcknowledgeTopic> topicMap = new HashMap<>();
+
+ for (Map.Entry<TopicIdPartition, List<AcknowledgementBatch>> entry :
acknowledgements.entrySet()) {
+ TopicIdPartition tip = entry.getKey();
+ String topicId = tip.topicId().toString();
+
+ TxnShareAcknowledgeTopic topic = topicMap.computeIfAbsent(topicId,
k -> {
+ TxnShareAcknowledgeTopic t = new
TxnShareAcknowledgeTopic().setTopicId(tip.topicId());
+ topics.add(t);
+ return t;
+ });
+
+ List<TxnShareAcknowledgeBatch> batches = new ArrayList<>();
+ for (AcknowledgementBatch b : entry.getValue()) {
+ for (byte ackType : b.acknowledgeTypes()) {
+ batches.add(new TxnShareAcknowledgeBatch()
+ .setFirstOffset(b.firstOffset())
+ .setLastOffset(b.lastOffset())
+ .setAcknowledgeType(ackType));
+ }
+ }
+
+ TxnShareAcknowledgePartition partition = new
TxnShareAcknowledgePartition()
+ .setPartitionIndex(tip.partition())
+ .setAcknowledgementBatches(batches);
+ topic.partitions().add(partition);
+ }
+
+ TxnShareAcknowledgeRequestData data = new
TxnShareAcknowledgeRequestData()
Review Comment:
TxnShareAcknowledgeRequest will be sent from produer at client side with all
producer deails
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]