Skip to content

Commit

Permalink
add code.
Browse files Browse the repository at this point in the history
  • Loading branch information
thetumbled committed Jan 18, 2024
1 parent b25d2c3 commit 1b5e90f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ public static Optional<RawMessage> rebatchMessage(RawMessage msg,
msg.getMessageIdData().getPartition(),
i);
if (!singleMessageMetadata.hasPartitionKey()) {
if (retainNullKey) {
// we may read compacted out message from compacted topic, which do not have partition key too.
if (retainNullKey && !singleMessageMetadata.isCompactedOut()) {
messagesRetained++;
Commands.serializeSingleMessageInBatchWithPayload(singleMessageMetadata,
singleMessagePayload, batchBuffer);
Expand Down

0 comments on commit 1b5e90f

Please sign in to comment.