From 31f5843c3985ca910c76569938f3eae54d48ab5c Mon Sep 17 00:00:00 2001 From: ayushaga14 Date: Tue, 10 Dec 2024 11:30:00 +0530 Subject: [PATCH] fix create mongo client params --- .../src/main/java/com/akto/threat/protection/Main.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/threat-protection-backend/src/main/java/com/akto/threat/protection/Main.java b/apps/threat-protection-backend/src/main/java/com/akto/threat/protection/Main.java index 8bf93cf399..dcc78a1290 100644 --- a/apps/threat-protection-backend/src/main/java/com/akto/threat/protection/Main.java +++ b/apps/threat-protection-backend/src/main/java/com/akto/threat/protection/Main.java @@ -4,6 +4,7 @@ import com.akto.threat.protection.utils.KafkaUtils; import com.mongodb.ConnectionString; import com.mongodb.ReadPreference; +import com.mongodb.WriteConcern; import com.mongodb.client.MongoClient; public class Main { @@ -15,7 +16,7 @@ public static void main(String[] args) throws Exception { MongoClient threatProtectionMongo = DaoInit.createMongoClient( new ConnectionString(System.getenv("AKTO_THREAT_PROTECTION_MONGO_CONN")), - ReadPreference.secondary()); + ReadPreference.secondary(), WriteConcern.ACKNOWLEDGED); String initProducer = System.getenv("INIT_KAFKA_PRODUCER"); if (initProducer != null && initProducer.equalsIgnoreCase("true")) { KafkaUtils.initKafkaProducer();