Salesforce component: removed initial replay id check
Description
See https://issues.apache.org/jira/browse/CAMEL-22173
Target
- [ ] I checked that the commit is targeting the correct branch (Camel 4 uses the
mainbranch)
For now the MR is targeting 4.10.x because it's easier for me to test the fix in our app
Tracking
- [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue]
https://issues.apache.org/jira/browse/CAMEL-22173
Apache Camel coding standards and style
-
[ ] I checked that each commit in the pull request has a meaningful subject line and body.
-
[ ] I have run
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
-
First-time contributors require MANUAL approval for the GitHub Actions to run
-
You can use the command
/component-test (camel-)component-name1 (camel-)component-name2..to request a test from the test bot. -
You can label PRs using
build-all,build-dependents,skip-testsandtest-dependentsto fine-tune the checks executed by this PR. -
Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.
-
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
There is a bit of TODO in this code. The old option can be marked as @Deprecated at first for older releases.
The code that stops the route is also debateable as no other components does that. Its better to let the route keep erroring as its not possible to subscribe to that topic. So maybe log a WARN instead.
Thanks for your feedback! As I mentioned in the Jira US, I had a few ideas about how to handle errors without stopping the route. I've pushed some changes with the second option: if the replay id is invalid, when fallbackToLatestReplayId is set then the consumer re-subscribes using ReplayPreset.LATEST; otherwise, an exception is passed to the consumer ExceptionHandler and no other action is taken. This means that the consumer will retry to subscribe with the same id and it will likely receive other errors, but if users want to stop the route they can plug a BridgeExceptionHandlerToErrorHandler and handle an InvalidReplayIdException in the route exception handler. LMK your thoughts. Meanwhile, I'll try to implement a couple of integration tests.
Thanks,
lorenzo
Thanks, it would be great if you can get this done today/tomorrow as we cut Camel 4.13 in the weekend and it would be good to get this included in that release.
I've added a couple of integration tests and moved the fallbackToLatestReplayId to the endpoint (I thought it was a better option in case someone has multiple subscribers and wants to configure different behaviors); as mentioned earlier, this branch comes from camel-4.10.x because that's what we're using and I wanted to be able to test the changes in our application without introducing other variables, but if you think that the code looks good I'll rebase the MR and target main. Thanks!
Just some small things. Yeah the code looks good. You are welcome to target main branch either as new PR or change this
I've updated the PR, using main as the target branch, and addressed the comments. Thanks!
/component-test camel-salesforce
Result :white_check_mark: The tests passed successfully
:robot: The Apache Camel test robot will run the tests for you :+1: