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();