Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mongodb] Expose updateLookup option for stream source. #1461

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public static class Builder<T> {
private Integer batchSize = BATCH_SIZE_DEFAULT;
private Integer pollAwaitTimeMillis = POLL_AWAIT_TIME_MILLIS_DEFAULT;
private Integer pollMaxBatchSize = POLL_MAX_BATCH_SIZE_DEFAULT;
private Boolean updateLookup = true;
private Boolean copyExisting = true;
private Integer copyExistingMaxThreads;
private Integer copyExistingQueueSize;
Expand Down Expand Up @@ -223,6 +224,19 @@ public Builder<T> pollMaxBatchSize(int pollMaxBatchSize) {
return this;
}

/**
* change.stream.full.document
*
* <p>Determines what to return for update operations when using a Change Stream. When set
* to true, the change stream for partial updates will include both a delta describing the
* changes to the document and a copy of the entire document that was changed from some time
* after the change occurred. Default: true
*/
public Builder<T> updateLookup(boolean updateLookup) {
this.updateLookup = updateLookup;
return this;
}

/**
* copy.existing
*
Expand Down Expand Up @@ -364,7 +378,11 @@ public DebeziumSourceFunction<T> build() {
props.setProperty(COLLECTION_INCLUDE_LIST, String.join(",", collectionList));
}

props.setProperty(MongoSourceConfig.FULL_DOCUMENT_CONFIG, FULL_DOCUMENT_UPDATE_LOOKUP);
if (updateLookup) {
props.setProperty(
MongoSourceConfig.FULL_DOCUMENT_CONFIG, FULL_DOCUMENT_UPDATE_LOOKUP);
}

props.setProperty(
MongoSourceConfig.PUBLISH_FULL_DOCUMENT_ONLY_CONFIG,
String.valueOf(Boolean.FALSE));
Expand Down