davsclaus opened a new pull request, #28251:
URL: https://github.com/apache/camel/pull/28251

   Stacked on #28250. This is the object storage group of the catalog body 
types (CAMEL-24961): aws2-s3, azure-storage-blob, dropbox, google-storage, 
ibm-cos, minio and azure-files. Of the components the human-written routes use, 
these are the storage ones used most: 17, 12, 8, 6, 6, 4 and 4 times.
   
   **What the catalog says now**
   
   | Component | Consumer | Producer input | Producer output |
   |---|---|---|---|
   | aws2-s3 | `bytes`; a `stream` with includeBody=false, no body with 
ignoreBody=true | without an operation, the content to upload: `text`, `bytes`, 
`stream` or `file` | `unchanged` after an upload. By operation: getObject a 
`stream`, the lists a `list`, the links `text`, deleteObject `true`, the SDK 
response for the others |
   | azure-storage-blob | a `stream`, or with fileDir the `file` | `any`. The 
uploads take `text`, `bytes`, `stream` or `file`, the block lists a `list` | a 
`list` for listBlobContainers (the default) and the other lists. getBlob a 
`stream`, downloadBlobToFile a `file`, `true` for the writes |
   | dropbox | get: the content, or a `map` for a folder. search: a `list` | 
`any`: localPath or a header can name the file to upload | put: OK or KO. get: 
as the consumer. del and move: the path. search: a `list` |
   | google-storage | the content, a `file` with downloadFileName, the Blob 
with includeBody=false | the content to upload | the Blob of the upload. 
getObject `bytes`, the lists a `list`, the deletes `true` or `false` |
   | ibm-cos | a `stream`; no body with includeBody=false | the content to 
upload with putObject | `unchanged` after putObject. getObject a `stream`, the 
lists a `list`, headBucket a Boolean |
   | minio | `bytes`; no body with includeBody=false | the content to upload | 
`unchanged` after an upload. getObject a `stream`, listObjects an Iterable and 
listBuckets an Iterator: `iterator` |
   | azure-files | the `file` as read, as for ftp | `text`, `bytes`, `stream` 
or `file` | `unchanged` |
   
   In every one of them, an upload of a Map or a List fails rather than sending 
its toString(). It is an InvalidPayloadException, or an 
IllegalArgumentException in azure-storage-blob. The descriptions say to marshal 
it first.
   
   **Checked at runtime.** Routes logged the class of the body after each step, 
against `camel infra run aws` (S3 on LocalStack) and `camel infra run azure` 
(Azurite):
   - **aws2-s3:**
     - every operation;
     - the upload of text, bytes, a stream and a file, and the failing Map, 
List and null;
     - pojoRequest, multiPartUpload and streamingUploadMode;
     - the consumer with includeBody and ignoreBody.
     With stream caching on, the next step after getObject sees the stream 
cache, not the SDK's ResponseInputStream.
   - **ibm-cos and minio:** against the same S3, ibm-cos through an `AmazonS3` 
client bean with HMAC keys, and minio through its endpoint option. The image of 
`camel infra run minio` needs a login on quay.io now.
   - **azure-storage-blob:** 16 operations, and the consumer with and without 
fileDir.
   - **dropbox, google-storage and azure-files:** these have no local server, 
so they were read from the code.
   
   **Options the component can set.** In aws2-s3, azure-storage-blob, 
google-storage, ibm-cos and minio, every option is a component option too, as 
the component shares its configuration. The validator counts a component option 
only when the endpoint sets it. So it checks a step only when the endpoint 
names the operation: after `aws2-s3:reports?operation=getObject` the body is a 
stream, and `aws2-s3:reports` says nothing. At runtime the operation header 
(such as CamelAwsS3Operation) wins over the option, as it does for aws2-sqs.
   
   **One validator change.** The validator called a body "the file as it was 
read (a GenericFile)" whenever `file` was one of its carriers. Now that 
wording, and the file properties such as `${body.fileName}`, apply only when 
the file is the only carrier. A blob that is a stream or a downloaded file is a 
payload like any other. Before this group, no side in the catalog mixed `file` 
with another payload carrier.
   
   **Docs.** The pages of aws2-s3, google-storage and minio said getObject 
returns an S3Object, a Blob or a MinioObject instance. It returns the content 
of the object. The aws2-s3 consumer example said includeBody=false gives only 
the metadata. It gives the stream, and ignoreBody=true gives the metadata only.
   
   **Measured.** I ran the validator over the 1204 human-written and 1209 
model-written route files, and the reports are the same as with #28250. The 
human files use these components 57 times. Most are Kamelets that pass the body 
to kamelet:sink, or uploads, or getObject through toD.
   
   **Tests**
   - `TextBodyFlowTest.testTheBodyOfObjectStorage` covers four routes:
     - a field read after getObject is reported;
     - a field read after the blob consumer is reported;
     - after an upload, which names no operation, nothing is reported;
     - nothing is reported on the List of dropbox search.
   - These pass:
     - the 281 tests of camel-yaml-dsl-validator;
     - the 265 validator and catalog doc tests of camel-jbang-core.
   - The answer of camel_catalog_doc stays under its 18 000 characters: 
aws2-s3, the largest, is 17 704.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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