davsclaus commented on code in PR #27682:
URL: https://github.com/apache/camel/pull/27682#discussion_r4240558116
##########
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:
Correction to my reply above: I was wrong about the reset.
`PooledExchangeFactory.release()` calls `done()` on the exchange itself, and
`done()` does nothing on a second call, so `releaseExchange(exchange, true)`
and `releaseExchange(exchange, false)` both reset the exchange before it goes
back to the pool. As you said, the two are equivalent here.
I still keep `false`, only so the call matches `createExchange(false)` in
this consumer. The reason I gave before (that the exchange would go back to the
pool without being reset) was wrong.
_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]