Skip to content

Commit

Permalink
fix create mongo client params
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushaga14 authored and ag060 committed Dec 10, 2024
1 parent 59a61a5 commit 31f5843
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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();
Expand Down

0 comments on commit 31f5843

Please sign in to comment.