You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/12/12 11:59:42 UTC
[GitHub] [camel] jwwallin opened a new pull request, #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobSize in uploadBlockBlob operation
jwwallin opened a new pull request, #8881:
URL: https://github.com/apache/camel/pull/8881
This PR adds support for `CamelAzureStorageBlobBlobSize`-header in the `camel-azure-storage-blob`-component producer.
Specifically this adds the ability to override `BlobUtils.getInputStreamLength()` in `BlobStreamAndLength` by providing a value to the `CamelAzureStorageBlobBlobSize`-header. To allow this change to work with the Azure SDK client, the `BloblClientWrapper` needed a change in how it calls `BlockBlobClient.uploadWithResponse()`. Functionally this change to the wrapper should be negligible as it does things very close to how the convenience method in the SDK, which was previously used, works.
- [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
- [x] Each commit in the pull request should have a meaningful subject line and body.
- [x] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
Below are the contribution guidelines:
https://github.com/apache/camel/blob/main/CONTRIBUTING.md
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] jwwallin commented on a diff in pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
jwwallin commented on code in PR #8881:
URL: https://github.com/apache/camel/pull/8881#discussion_r1045971951
##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobStreamAndLength.java:
##########
@@ -40,14 +40,16 @@ private BlobStreamAndLength(InputStream inputStream, long streamLength) {
@SuppressWarnings("rawtypes")
public static BlobStreamAndLength createBlobStreamAndLengthFromExchangeBody(final Exchange exchange) throws IOException {
Object body = exchange.getIn().getBody();
+ Long blobSize = exchange.getIn().getHeader(BlobConstants.BLOB_UPLOAD_SIZE, () -> null, Long.class);
Review Comment:
I was wondering about that as-well. It's at least better than the current spot, since it's in context. :+1:
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus commented on a diff in pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #8881:
URL: https://github.com/apache/camel/pull/8881#discussion_r1045970052
##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobStreamAndLength.java:
##########
@@ -40,14 +40,16 @@ private BlobStreamAndLength(InputStream inputStream, long streamLength) {
@SuppressWarnings("rawtypes")
public static BlobStreamAndLength createBlobStreamAndLengthFromExchangeBody(final Exchange exchange) throws IOException {
Object body = exchange.getIn().getBody();
+ Long blobSize = exchange.getIn().getHeader(BlobConstants.BLOB_UPLOAD_SIZE, () -> null, Long.class);
Review Comment:
You can maybe remove the header here instead?
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346678786
### Components tested:
| Total | Tested | Failed :x: | Passed :white_check_mark: |
| --- | --- | --- | --- |
| 1 | 1 | 1 | 1 |
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus commented on a diff in pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #8881:
URL: https://github.com/apache/camel/pull/8881#discussion_r1045970458
##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobStreamAndLength.java:
##########
@@ -40,14 +40,16 @@ private BlobStreamAndLength(InputStream inputStream, long streamLength) {
@SuppressWarnings("rawtypes")
public static BlobStreamAndLength createBlobStreamAndLengthFromExchangeBody(final Exchange exchange) throws IOException {
Object body = exchange.getIn().getBody();
+ Long blobSize = exchange.getIn().getHeader(BlobConstants.BLOB_UPLOAD_SIZE, () -> null, Long.class);
Review Comment:
As the remove will give you back the header
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346841888
### Components tested:
| Total | Tested | Failed :x: | Passed :white_check_mark: |
| --- | --- | --- | --- |
| 1 | 1 | 0 | 2 |
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346420828
is there a problem if the same header is used in both consumer and producer, if you go ala
from s3-blob
set Body
// change body here
to s3-blob
Then the old header with the length may be in use
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] jwwallin commented on a diff in pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
jwwallin commented on code in PR #8881:
URL: https://github.com/apache/camel/pull/8881#discussion_r1045975800
##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobStreamAndLength.java:
##########
@@ -40,14 +40,16 @@ private BlobStreamAndLength(InputStream inputStream, long streamLength) {
@SuppressWarnings("rawtypes")
public static BlobStreamAndLength createBlobStreamAndLengthFromExchangeBody(final Exchange exchange) throws IOException {
Object body = exchange.getIn().getBody();
+ Long blobSize = exchange.getIn().getHeader(BlobConstants.BLOB_UPLOAD_SIZE, () -> null, Long.class);
Review Comment:
Change done.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] jwwallin commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
jwwallin commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346440753
> is there a problem if the same header is used in both consumer and producer, if you go ala
>
> from s3-blob set Body // change body here to s3-blob
>
> Then the old header with the length may be in use, instead of calculating a new length because the body is changed. We have this problem in some of the other components, where you then have to remove headers
It would then propagate through, that's true... Would it be more convenient to then use a separate header for producer operations?
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] jwwallin commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
jwwallin commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346708932
Would this get backported to 3.18.x as well? That's the version we are currently using.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus merged pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
davsclaus merged PR #8881:
URL: https://github.com/apache/camel/pull/8881
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobUploadSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346818620
### Components tested:
| Total | Tested | Failed :x: | Passed :white_check_mark: |
| --- | --- | --- | --- |
| 1 | 1 | 0 | 2 |
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346456805
Yeah that is better, and we usually also remove the header so it does not cause issues in case you upload something else to s3 later
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346349337
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:warning: Please note that the changes on this PR may be **tested automatically**.
If necessary Apache Camel Committers may access logs and test results in the job summaries!
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8881: [Camel-18808] add support for CamelAzureStorageBlobBlobSize in uploadBlockBlob operation
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8881:
URL: https://github.com/apache/camel/pull/8881#issuecomment-1346451926
### Components tested:
| Total | Tested | Failed :x: | Passed :white_check_mark: |
| --- | --- | --- | --- |
| 1 | 1 | 0 | 1 |
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org