Skip to content

Commit 4781d81

Browse files
committed
GH-1672: More Sonar Polishing
1 parent dcce9d0 commit 4781d81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,10 +1825,6 @@ private void invokeRecordListenerInTx(final ConsumerRecords<K, V> records) {
18251825
}
18261826
this.logger.trace(() -> "Processing " + ListenerUtils.recordToString(record));
18271827
try {
1828-
if (this.producerPerConsumerPartition) {
1829-
TransactionSupport
1830-
.setTransactionIdSuffix(zombieFenceTxIdSuffix(record.topic(), record.partition()));
1831-
}
18321828
invokeInTransaction(iterator, record);
18331829
}
18341830
catch (ProducerFencedException | FencedInstanceIdException e) {
@@ -1856,6 +1852,10 @@ private void invokeRecordListenerInTx(final ConsumerRecords<K, V> records) {
18561852
}
18571853

18581854
private void invokeInTransaction(Iterator<ConsumerRecord<K, V>> iterator, final ConsumerRecord<K, V> record) {
1855+
if (this.producerPerConsumerPartition) {
1856+
TransactionSupport
1857+
.setTransactionIdSuffix(zombieFenceTxIdSuffix(record.topic(), record.partition()));
1858+
}
18591859
this.transactionTemplate.execute(new TransactionCallbackWithoutResult() {
18601860

18611861
@Override

0 commit comments

Comments
 (0)