Skip to content

Commit be2e5b7

Browse files
committed
Fix send to offset to tx, when no active tx
. Signed-off-by: moonyougnCHAE <[email protected]>
1 parent 17fe0ff commit be2e5b7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,6 +3080,9 @@ else if (!this.autoCommit && (!this.isAnyManualAck || commitRecovered)) {
30803080
}
30813081

30823082
private void sendOffsetsToTransaction() {
3083+
if (this.kafkaTxManager != null && TransactionSynchronizationManager.getResource(this.kafkaTxManager.getProducerFactory()) == null) {
3084+
return;
3085+
}
30833086
handleAcks();
30843087
Map<TopicPartition, OffsetAndMetadata> commits = buildCommits();
30853088
this.commitLogger.log(() -> "Sending offsets to transaction: " + commits);

0 commit comments

Comments
 (0)