mongo-kafka icon indicating copy to clipboard operation
mongo-kafka copied to clipboard

Support setting a custom deletewritemode.strategy

Open ArneKlein opened this issue 2 years ago • 1 comments

Hi,

we currently have the scenario where we have to create multi version of the same document based on a key in the value and delete all versions based on the key once we receive a tombstone event.

To support this scenario, it would be great to enable setting a custom "deletewritemodel.strategy" just as we currently can for the normal writemodel.strategy

https://jira.mongodb.org/browse/KAFKA-320

ArneKlein avatar Jul 14 '22 12:07 ArneKlein

Apologies for the delay in reviewing.

I've added a couple of minor nits for being included into master. I would like to see some tests added to test the new logic

Thank you for the review, I added basically the same tests as for getWriteModelStrategy(). Please let me know if this is sufficient

ArneKlein avatar Sep 21 '22 13:09 ArneKlein

LGTM

rozza avatar Oct 04 '22 13:10 rozza

Any chance that this can get merged?

ArneKlein avatar Mar 30 '23 16:03 ArneKlein

Note: the latest patch doesn't compile:

com/mongodb/kafka/connect/sink/MongoSinkConfigTest.java:812: error: incompatible types: Optional<WriteModelStrategy> cannot be converted to WriteModelStrategy
               cfg.getMongoSinkTopicConfig(TEST_TOPIC).getDeleteWriteModelStrategy();

jyemin avatar Apr 06 '23 23:04 jyemin