From a8d111e11dba7881f054112676059da8491208ac Mon Sep 17 00:00:00 2001 From: Roman Zabaluev Date: Sat, 17 Feb 2024 18:45:31 +0700 Subject: [PATCH] Audit: Skip preprocessing if there's nowhere to log (#94) --- api/src/main/java/io/kafbat/ui/service/audit/AuditService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java b/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java index 66004b004..be386c92f 100644 --- a/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java +++ b/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java @@ -207,6 +207,9 @@ public boolean isAuditTopic(KafkaCluster cluster, String topic) { } public void audit(AccessContext acxt, Signal sig) { + if (auditWriters.isEmpty()) { + return; + } if (sig.isOnComplete()) { extractUser(sig) .doOnNext(u -> sendAuditRecord(acxt, u))