Uploaded image for project: 'Red Hat build of Apache Camel for Spring Boot'
  1. Red Hat build of Apache Camel for Spring Boot
  2. CSB-630

Camel-Minio deleteObjects operation does not delete multiple objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • CSB-3.18
    • None
    • Camel
    • None
    • Very Likely
    • 0

      The bug is in the org.apache.camel.component.minio.MinioProducer.deleteObjects() method.
      Minio API expects client to iterate the target objects by themselves, but the MinioProducer.deleteObjects() has no iteration in the method.

      https://min.io/docs/minio/linux/developers/java/API.html#removeobjects-removeobjectsargs-args
      Removes multiple objects lazily. Its required to iterate the returned Iterable to perform removal.

      rhi-camel-spring-boot-3.14.2.CR6-src/camel-3.14.2/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioProducer.java

          private void deleteObjects(MinioClient minioClient, Exchange exchange) throws Exception {
              if (getConfiguration().isPojoRequest()) {
                  RemoveObjectsArgs.Builder payload = exchange.getIn().getMandatoryBody(RemoveObjectsArgs.Builder.class);
                  if (isNotEmpty(payload)) {
                      minioClient.removeObjects(payload.build());
                      Message message = getMessageForResponse(exchange);
                      message.setBody(true);
                  }
              } else {
                  throw new IllegalArgumentException("Cannot delete multiple objects without a POJO request");
              }
          }
      

      It looks like there is no test code for MinioOperations.deleteObjects in org.apache.camel.component.minio.integration.MinioDeleteBucketOperationIT test class.

              ldemasi Luigi De Masi
              rhn-support-hfuruich Hisao Furuichi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: