cleanup code by sonar

This commit is contained in:
三丙
2024-10-11 15:27:42 +08:00
parent 62a712ea36
commit 22c93292d0
6 changed files with 20 additions and 20 deletions

View File

@@ -60,7 +60,7 @@ public abstract class AbstractQueueConsumerTemplate<R, T extends QueueMsg> imple
List<R> records;
long startNanos = System.nanoTime();
if (stopped) {
log.error("poll invoked but consumer stopped for topic " + topic, new RuntimeException("stacktrace"));
log.error("poll invoked but consumer stopped for topic {}", topic, new RuntimeException("stacktrace"));
return emptyList();
}
if (!subscribed && partitions == null && subscribeQueue.isEmpty()) {
@@ -68,7 +68,7 @@ public abstract class AbstractQueueConsumerTemplate<R, T extends QueueMsg> imple
}
if (consumerLock.isLocked()) {
log.error("poll. consumerLock is locked. will wait with no timeout. it looks like a race conditions or deadlock topic " + topic, new RuntimeException("stacktrace"));
log.error("poll. consumerLock is locked. will wait with no timeout. it looks like a race conditions or deadlock topic {}", topic, new RuntimeException("stacktrace"));
}
consumerLock.lock();
@@ -132,7 +132,7 @@ public abstract class AbstractQueueConsumerTemplate<R, T extends QueueMsg> imple
@Override
public void commit() {
if (consumerLock.isLocked()) {
log.error("commit. consumerLock is locked. will wait with no timeout. it looks like a race conditions or deadlock topic " + topic, new RuntimeException("stacktrace"));
log.error("commit. consumerLock is locked. will wait with no timeout. it looks like a race conditions or deadlock topic {}", topic, new RuntimeException("stacktrace"));
}
consumerLock.lock();
try {