Skip to content

Commit

Permalink
Let data-prepper-core know if docdb has acknowledgments enabled (open…
Browse files Browse the repository at this point in the history
…search-project#4467)

Signed-off-by: Taylor Gray <[email protected]>
  • Loading branch information
graytaylor0 authored Apr 26, 2024
1 parent 9b1b05e commit aea97da
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class DocumentDBSource implements Source<Record<Event>>, UsesEnhancedSour
private final AcknowledgementSetManager acknowledgementSetManager;
private DocumentDBService documentDBService;

private final boolean acknowledgementsEnabled;

@DataPrepperPluginConstructor
public DocumentDBSource(final PluginMetrics pluginMetrics,
final MongoDBSourceConfig sourceConfig,
Expand All @@ -44,6 +46,7 @@ public DocumentDBSource(final PluginMetrics pluginMetrics,
this.sourceConfig = sourceConfig;
this.acknowledgementSetManager = acknowledgementSetManager;
this.pluginConfigObservable = pluginConfigObservable;
this.acknowledgementsEnabled = sourceConfig.isAcknowledgmentsEnabled();
}

@Override
Expand Down Expand Up @@ -77,4 +80,9 @@ public void setEnhancedSourceCoordinator(EnhancedSourceCoordinator sourceCoordin
public Function<SourcePartitionStoreItem, EnhancedSourcePartition> getPartitionFactory() {
return new PartitionFactory();
}

@Override
public boolean areAcknowledgementsEnabled() {
return acknowledgementsEnabled;
}
}

0 comments on commit aea97da

Please sign in to comment.