diff --git a/apps/threat-detection/src/main/java/com/akto/threat/detection/tasks/MaliciousTrafficDetectorTask.java b/apps/threat-detection/src/main/java/com/akto/threat/detection/tasks/MaliciousTrafficDetectorTask.java index 8ba585806a..789d6915e7 100644 --- a/apps/threat-detection/src/main/java/com/akto/threat/detection/tasks/MaliciousTrafficDetectorTask.java +++ b/apps/threat-detection/src/main/java/com/akto/threat/detection/tasks/MaliciousTrafficDetectorTask.java @@ -290,22 +290,13 @@ private void generateAndPushMaliciousEventRequest( .setLatestApiMethod(maliciousReq.getMethod()) .setDetectedAt(responseParam.getTime()) .build(); - try { MaliciousEventKafkaEnvelope envelope = - MaliciousEventKafkaEnvelope.newBuilder() - .setActor(actor) - .setAccountId(responseParam.getAccountId()) - .setMaliciousEvent(maliciousEvent) - .build(); - MessageEnvelope.generateEnvelope(responseParam.getAccountId(), actor, maliciousEvent) - .marshal() - .ifPresent( - data -> { - internalKafka.send(KafkaTopic.ThreatDetection.ALERTS, envelope); - }); - } catch (InvalidProtocolBufferException e) { - e.printStackTrace(); - } + MaliciousEventKafkaEnvelope.newBuilder() + .setActor(actor) + .setAccountId(responseParam.getAccountId()) + .setMaliciousEvent(maliciousEvent) + .build(); + internalKafka.send(KafkaTopic.ThreatDetection.ALERTS, envelope); } public static HttpResponseParams buildHttpResponseParam(HttpResponseParam httpResponseParamProto) {