Restart Source Feed / Snapshot #572
-
Does anyone know if there is a way to restart the Source connector so it reloads the Container? Initially, I loaded a container, now I'd like to reload it again, but it only grabs the change feed now. Is there a property I can set? Thanks in advance!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
And just like that, I solved my own problem. I found in code that the connector creates a "Lease" container in Cosmos that controls the source. I just deleted the lease record and it restarted. Hope this helps someone else. |
Beta Was this translation helpful? Give feedback.
-
Hello @CloudFocused though that sounds like a solution, but it is hacky, since you are directly modifying the lease container (which is supposed to be used only internally). There should be another way - change feed from beginning, but I don't think that config is exposed on this version of kafka connector. We are in process of deprecating this version of kafka connector, since its very limited in what it can do. I will recommend using our v2 kafka connector - which is released on maven - https://mvnrepository.com/artifact/com.azure.cosmos.kafka/azure-cosmos-kafka-connect This has a config - where you can specify how to handle the changes from cosmos db - https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/CosmosSourceConfig.java#L48 |
Beta Was this translation helpful? Give feedback.
And just like that, I solved my own problem. I found in code that the connector creates a "Lease" container in Cosmos that controls the source. I just deleted the lease record and it restarted. Hope this helps someone else.