From aea97dab3e37bc85d21966ac8fafaac90aa10dec Mon Sep 17 00:00:00 2001 From: Taylor Gray Date: Fri, 26 Apr 2024 10:39:09 -0500 Subject: [PATCH] Let data-prepper-core know if docdb has acknowledgments enabled (#4467) Signed-off-by: Taylor Gray --- .../plugins/mongo/documentdb/DocumentDBSource.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data-prepper-plugins/mongodb/src/main/java/org/opensearch/dataprepper/plugins/mongo/documentdb/DocumentDBSource.java b/data-prepper-plugins/mongodb/src/main/java/org/opensearch/dataprepper/plugins/mongo/documentdb/DocumentDBSource.java index 865eaf3781..b6ff1fbdf1 100644 --- a/data-prepper-plugins/mongodb/src/main/java/org/opensearch/dataprepper/plugins/mongo/documentdb/DocumentDBSource.java +++ b/data-prepper-plugins/mongodb/src/main/java/org/opensearch/dataprepper/plugins/mongo/documentdb/DocumentDBSource.java @@ -35,6 +35,8 @@ public class DocumentDBSource implements Source>, UsesEnhancedSour private final AcknowledgementSetManager acknowledgementSetManager; private DocumentDBService documentDBService; + private final boolean acknowledgementsEnabled; + @DataPrepperPluginConstructor public DocumentDBSource(final PluginMetrics pluginMetrics, final MongoDBSourceConfig sourceConfig, @@ -44,6 +46,7 @@ public DocumentDBSource(final PluginMetrics pluginMetrics, this.sourceConfig = sourceConfig; this.acknowledgementSetManager = acknowledgementSetManager; this.pluginConfigObservable = pluginConfigObservable; + this.acknowledgementsEnabled = sourceConfig.isAcknowledgmentsEnabled(); } @Override @@ -77,4 +80,9 @@ public void setEnhancedSourceCoordinator(EnhancedSourceCoordinator sourceCoordin public Function getPartitionFactory() { return new PartitionFactory(); } + + @Override + public boolean areAcknowledgementsEnabled() { + return acknowledgementsEnabled; + } }