Saravanakumar Selvaraj created CAMEL-27757:
----------------------------------------------
Summary: camel-alibaba-oss: listBuckets returns only the first
page, and a route cannot page through listObjects
Key: CAMEL-27757
URL: https://issues.apache.org/jira/browse/CAMEL-27757
Project: Camel
Issue Type: Bug
Affects Versions: 4.23.0
Reporter: Saravanakumar Selvaraj
I checked the code of main at e785ba78ad52 and of alibabacloud-oss-v2 0.6.1. I
also read the ListBuckets (GetService) and GetBucket (ListObjects) pages of the
OSS API reference:
https://www.alibabacloud.com/help/en/oss/developer-reference/listbuckets
https://www.alibabacloud.com/help/en/oss/developer-reference/listobjects
listBuckets:
- OSSProducer.listBuckets sends one ListBuckets request without max-keys and
without a marker. It ignores IsTruncated and NextMarker of the result.
- The service returns at most 100 buckets by default, as the API page and the
Javadoc of ListBucketsRequest say. So an account with more than 100 buckets
gets the first 100, with no sign that more exist.
- No option or header reaches listBuckets, so a route cannot raise max-keys or
pass a marker.
- The SDK has OSSClient.listBucketsPaginator, which follows NextMarker. The
producer does not use it.
listObjects:
- Without maxKeys, OSSProducer.listObjects follows NextMarker and returns every
matching object in one List. It sends no max-keys, so the service returns pages
of 100 keys, its default.
- The API page counts each call as one PUT request for billing. It also says
that ListObjectsV2 supersedes ListObjects. The consumer already uses
ListObjectsV2.
- With maxKeys, the producer returns the first maxKeys objects. It gives no
IsTruncated and no next marker, in a header or in the body.
- No option or header sets a marker. So a route gets the first maxKeys objects
or all of them, but cannot ask for the next maxKeys.
- The producer sends maxKeys as max-keys on every page. The API page says that
the service rejects a max-keys above 1000 with InvalidArgument. The Javadoc of
ListObjectsRequest.maxKeys gives 1 to 999 instead.
- The maxKeys option text gives the limit of 1000, but the
CamelAlibabaOssMaxKeys header text gives no limit.
Proposed change:
- listBuckets follows NextMarker and returns every bucket, as listObjects does
without maxKeys.
- Paging headers for listObjects: the marker in, and the next marker out.
- ListObjectsV2 in listObjects, as in the consumer.
- The largest page size that the service accepts, when the producer lists every
object or bucket.
- The limit in the CamelAlibabaOssMaxKeys header text.
_Claude Code on behalf of saravanakumar1987_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)