Dhairya-007 opened a new pull request, #29975:
URL: https://github.com/apache/camel/pull/29975

   ## Problem
   
   The `getObject` producer operation and the consumer fill the same block of 
blob headers. From `GoogleCloudStorageProducer`:
   
   ```java
   message.setHeader(GoogleCloudStorageConstants.OBJECT_NAME, blob.getName());
   message.setHeader(GoogleCloudStorageConstants.CACHE_CONTROL, 
blob.getCacheControl());
   message.setHeader(GoogleCloudStorageConstants.METADATA_COMPONENT_COUNT, 
blob.getComponentCount());
   message.setHeader(GoogleCloudStorageConstants.CONTENT_DISPOSITION, 
blob.getContentDisposition());
   message.setHeader(GoogleCloudStorageConstants.CONTENT_ENCODING, 
blob.getContentEncoding());
   message.setHeader(GoogleCloudStorageConstants.METADATA_CONTENT_LANGUAGE, 
blob.getContentLanguage());
   ...
   message.setHeader(GoogleCloudStorageConstants.METADATA_ETAG, blob.getEtag());
   message.setHeader(GoogleCloudStorageConstants.METADATA_GENERATION, 
blob.getGeneration());
   ```
   
   The twenty headers set there are documented inconsistently. Seven carry no 
label and land in `common`; twelve carry `label = "consumer"` although the 
producer sets them in the very same statements:
   
   | header | label |
   | --- | --- |
   | `CamelGoogleCloudStorageETag` | *(none)* |
   | `CamelGoogleCloudStorageGeneration` | `consumer` |
   | `CamelGoogleCloudStorageContentType` | *(none)* |
   | `CamelGoogleCloudStorageContentLanguage` | `consumer` |
   
   so `ETag` is a common header while the generation number declared on the 
next line is consumer-only, and a route doing 
`to("google-storage:bucket?operation=getObject")` finds most of the metadata it 
just received filed under the consumer section it does not use.
   
   `BUCKET_NAME` and `OBJECT_NAME` have the mirror image: they are labelled 
`producer`, and the consumer sets both on every exchange it creates,
   
   ```java
   message.setHeader(GoogleCloudStorageConstants.OBJECT_NAME, key);
   message.setHeader(GoogleCloudStorageConstants.BUCKET_NAME, 
getConfiguration().getBucketName());
   ```
   
   and reads them back in its idempotent-repository and on-completion paths.
   
   ## Fix
   
   Drop the one-sided label from those 14 headers, so all twenty blob headers 
sit in `common`, as the seven already did. `CamelGoogleCloudStorageFileName` 
stays `consumer` - only the consumer sets that one - and the genuinely 
producer-only inputs (`operation`, `prefix`, the destination names, the 
download-link expiry) keep their `producer` label.
   
   No header name, type or behaviour changes. The regenerated 
`google-storage.json` files are included; header entries keep their declaration 
order, so only the group and label fields move.


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