CAMEL-23336: camel-mongodb - Expose Resume Token (Change Streams Consumer)#22674
CAMEL-23336: camel-mongodb - Expose Resume Token (Change Streams Consumer)#22674Michwo wants to merge 5 commits intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
Please run a full mvn clean install -DskipTests from root folder. |
|
you need to build the source code for the entire project as when you add new options there are code changed elsewhere |
| @Order(5) | ||
| @Test | ||
| public void invalidResumeTokenShouldFailToStartRoute() { | ||
| assertThrows(Exception.class, () -> context.getRouteController().startRoute("invalidResumeTokenConsumer")); | ||
| } | ||
|
|
There was a problem hiding this comment.
I think it will be worthy to add also a test when the resume token is valid to check for the happy path
Hi, thanks for the info. I think my problem is that I've done the build on Windows and it messed up all the line endings in generated source (over 3k files changed). I've commited the changes inside components/camel-mongodb but that seems not enough. I will try to run the build on linux next week. |
|
Hi @Michwo I think that this feature can be implemented with Camel's resume strategy (ResumeAware Consumer). Using the resume strategy, the Camel route would look like: The resumeToken handling will be offloaded to the framework, and hopefully it will be easier to use. The ResumeAware implementation can be done in another PR, no need to change the current implementation, but please open an issue about it. fyi @orpiske |
Description
Adds option to configure the change streams resume token in change streams consumer endpoint (property
resumeToken) and exposes the current resume token in exchange header (MongoDBConstants.RESUME_TOKEN).