oscerd opened a new pull request, #24835:
URL: https://github.com/apache/camel/pull/24835

   ## Description
   
   Fixes [CAMEL-24191](https://issues.apache.org/jira/browse/CAMEL-24191) 
(split out of the AWS review umbrella CAMEL-24156). Two defects in the 
KCL-based Kinesis consumer (`KclKinesis2Consumer`):
   
   1. **Session credentials silently ignored.** In both the DynamoDB and 
CloudWatch async-client builders the branch order tested `accessKey && 
secretKey` before `accessKey && secretKey && sessionToken`, so the 
session-token branch was unreachable and those clients never used STS temporary 
credentials. The session-credentials branch is now checked first in both 
builders.
   
   2. **Checkpoint/error handling lost or reprocessed data.** `processRecords` 
wrapped processing in `catch (Throwable t)` that logged a message **without** 
the exception and did not rethrow, so the scheduler later checkpointed past 
records that failed to process (data loss); it also never checkpointed after a 
successful batch, so a crash reprocessed the whole lease. It now:
      - checkpoints **only after** the batch has been processed successfully;
      - on failure, routes the exception to the consumer `ExceptionHandler` 
(with stack trace) and does **not** checkpoint, so KCL redelivers the batch 
from the last checkpoint.
   
   ## Tests
   
   Adds `KclKinesis2ConsumerRecordProcessingTest` — asserts the checkpoint is 
taken after a successful batch and is **never** taken when processing throws. 
Existing kinesis tests continue to pass.
   
   ## Backport
   
   Same code on `camel-4.18.x` and `camel-4.14.x`; will be backported after 
merge (fixVersions 4.22.0 / 4.18.4 / 4.14.9).
   
   Related to CAMEL-24156.
   
   ---
   _Claude Code on behalf of oscerd_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to