Skip to content

Commit

Permalink
optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
notshivansh committed Jan 3, 2025
1 parent fb3e1b6 commit eb9f899
Showing 1 changed file with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eb9f899

Please sign in to comment.