davsclaus commented on code in PR #27682:
URL: https://github.com/apache/camel/pull/27682#discussion_r4240552005
##########
components/camel-aws/camel-aws2-s3-vectors/src/main/java/org/apache/camel/component/aws2/s3vectors/AWS2S3VectorsConsumer.java:
##########
@@ -168,6 +172,13 @@ public int processBatch(Queue<Object> exchanges) throws
Exception {
AsyncCallback cb = defaultConsumerCallback(exchange, true);
getAsyncProcessor().process(exchange, cb);
}
+ // the remaining exchanges are not processed as the consumer is
stopping, so a later poll must consume their
+ // vectors again
+ for (Object exchange : exchanges) {
+ releaseVector(((Exchange)
exchange).getIn().getHeader(AWS2S3VectorsConstants.VECTOR_ID, String.class));
+ releaseExchange((Exchange) exchange, false);
Review Comment:
Thanks for checking. I kept `false` on purpose: the flag must match how the
exchange was created, and it differs between the consumers.
- `AWS2S3VectorsConsumer` creates its exchanges with `createExchange(false)`
(line 116), so `releaseExchange(exchange, false)` is the matching call. For a
pooled exchange it calls `PooledExchange.done()` before giving it back to the
factory (`DefaultConsumer.releaseExchange`).
- The blob, oss and obs consumers create theirs with `createExchange(true)`,
so they release with `true`.
With `true` here, the `done()` call would be skipped, and with
`PooledExchangeFactory` a non-auto-release exchange would go back to the pool
without being reset. So the two values are not equivalent in this consumer, and
I left the code as it is.
_Claude Code on behalf of davsclaus_
--
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]