camel-salesforce: Improve error resilience in subscription failure handling#22840
Conversation
c75c2ec to
d416819
Compare
|
@jeremyross just in case you have a bit time to quickly take a look |
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
All tested modules (10 modules)
|
gnodet
left a comment
There was a problem hiding this comment.
Thanks for improving the error resilience in the Salesforce Streaming subscription handling, @shaipan! This addresses a real operational pain point. A few observations:
Missing tests: Per project standards, every PR should include tests for new behavior. The new error handling paths in subscriptionFailed() and the extended isTemporaryError() method are not covered by the existing SubscriptionHelperTest. Unit tests verifying that IOException, TransportException, and TimeoutException are treated as temporary, and that the various 401/403 error strings trigger retry, would strengthen confidence in these changes.
401/403 retry without token refresh: Treating AUTHENTICATION_INVALID (401) and authorization errors (403) as retryable is reasonable for transient failures. However, the retry path re-calls subscribe() without explicitly triggering a session token refresh. If the token is genuinely expired, all retries may fail identically, consuming the full backoff budget before aborting. Worth confirming that the CometD handshake/subscribe path handles token refresh internally.
Minor: Two comments explaining the non-obvious Tasks.foregroundTask() usage (using initialDelay as a sleep and maxIterations(1) to run once) were removed. The pattern isn't self-documenting — consider keeping them.
Claude Code on behalf of Guillaume Nodet
…n missing error, restore comments
@gnodet The methods are private and the existing test pattern in the file doesn't cover listener callbacks. |
|
Thanks @shaipan |
|
Hi @gnodet @davsclaus are we good to commit this? Or any more chanegs needed from my side. I have 2 3 more bugs in this area to commit. |
|
I created a ticket to capture your PRs in CAMEL-23391 as we need this for the release notes to track notice changes in this component |
Improve error handling in SubscriptionHelper to recover from more transient Salesforce
Streaming API failures instead of aborting the subscription.
org daily event limit, and missing error message failures
instead of retrying indefinitely