gnodet commented on code in PR #27682:
URL: https://github.com/apache/camel/pull/27682#discussion_r4240548284


##########
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:
   💡 **Nit:** `releaseExchange((Exchange) exchange, false)` while the other 
three consumers all use `true` here. Both are equivalent when `autoRelease` is 
set on creation, but consistency would be cleaner.
   
   ```suggestion
               releaseVector(((Exchange) 
exchange).getIn().getHeader(AWS2S3VectorsConstants.VECTOR_ID, String.class));
               releaseExchange((Exchange) exchange, true);
   ```



-- 
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