加日志
This commit is contained in:
@@ -61,11 +61,20 @@ public class NameplateKafkaConsumer {
|
|||||||
if (!"INSERT".equals(tmNameplateCorpus.getType()) || CollectionUtils.isEmpty(tmNameplateCorpus.getData())) {
|
if (!"INSERT".equals(tmNameplateCorpus.getType()) || CollectionUtils.isEmpty(tmNameplateCorpus.getData())) {
|
||||||
ack.acknowledge();
|
ack.acknowledge();
|
||||||
}
|
}
|
||||||
|
|
||||||
tmNameplateCorpus.getData().forEach(nameplate ->
|
tmNameplateCorpus.getData().forEach(nameplate ->
|
||||||
tmNameplateCorpusService.processItem(nameplate));
|
tmNameplateCorpusService.processItem(nameplate));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("处理消息失败", e);
|
log.error("处理消息失败", e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
ack.acknowledge(); // 提交 offset
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
log.warn("Offset 已提交,跳过重复提交");
|
||||||
|
}
|
||||||
|
|
||||||
|
log.error("释放许可,当前可用许可数:{}", semaphore.availablePermits());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user