Azure Storage Blob Service
Since Camel 3.3
Both producer and consumer are supported
The Azure Storage Blob component is used for storing and retrieving blobs from Azure Storage Blob Service using Azure APIs v12. However, in the case of versions above v12, we will see if this component can adopt these changes depending on how much breaking changes can result.
Prerequisites
You must have a valid Windows Azure Storage account. More information is available at Azure Documentation Portal.
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-azure-storage-blob</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency> URI Format
azure-storage-blob://accountName[/containerName][?options] In the case of a consumer, accountName, containerName are required.
In the case of a producer, it depends on the operation that is being requested, for example, if operation is on a container level, e.b: createContainer, accountName and containerName are only required, but in case of operation being requested in blob level, e.g: getBlob, accountName, containerName and blobName are required.
The blob will be created if it does not already exist. You can append query options to the URI in the following format, ?options=value&option2=value&…
Configuring Options
Camel components are configured on two separate levels:
-
component level
-
endpoint level
Configuring Component Options
At the component level, you set general and shared configurations that are, then, inherited by the endpoints. It is the highest configuration level.
For example, a component may have security settings, credentials for authentication, urls for network connection and so forth.
Some components only have a few options, and others may have many. Because components typically have pre-configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.
You can configure components using:
-
the Component DSL.
-
in a configuration file (
application.properties,*.yamlfiles, etc). -
directly in the Java code.
Configuring Endpoint Options
You usually spend more time setting up endpoints because they have many options. These options help you customize what you want the endpoint to do. The options are also categorized into whether the endpoint is used as a consumer (from), as a producer (to), or both.
Configuring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the Endpoint DSL and DataFormat DSL as a type safe way of configuring endpoints and data formats in Java.
A good practice when configuring options is to use Property Placeholders.
Property placeholders provide a few benefits:
-
They help prevent using hardcoded urls, port numbers, sensitive information, and other settings.
-
They allow externalizing the configuration from the code.
-
They help the code to become more flexible and reusable.
The following two sections list all the options, firstly for the component followed by the endpoint.
Component Options
The Azure Storage Blob Service component supports the following options which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
The name of the blob. With it, the consumer reads only this blob, in each poll, and without it the consumer reads all the blobs of the container. The producer requires it for each operation on a blob, and the CamelAzureStorageBlobBlobName header replaces it. For copyBlob it is the name of both the source blob and the blob that the copy creates. | String | ||
The position in bytes of the first byte to read from the blob, for the consumer and for getBlob, downloadBlobToFile and getPageBlobRanges. Must be 0 or more. | 0 | long | |
The type of blob, which only changes the range that getBlob, downloadBlobToFile and getPageBlobRanges read: with pageblob, the CamelAzureStorageBlobPageBlobRange header, if set, gives the range instead of blobOffset and dataCount. The operation decides which type of blob it creates or writes. Enum values:
| blockblob | BlobType | |
Whether the consumer and getBlob close the stream of the blob content: the InputStream body when the exchange completes, or the OutputStream body that getBlob writes into once the download is done. If false, the route must close it. | true | boolean | |
The configuration that each endpoint of this component starts from, before the options of the endpoint are applied. | BlobConfiguration | ||
Autowired To use a com.azure.storage.common.StorageSharedKeyCredential, which holds the account name and an account key of the storage account, when credentialType is SHARED_KEY_CREDENTIAL or SHARED_ACCOUNT_KEY. When it is set, its account name gives the address of the service, and the accountName and accessKey options are not used to authenticate. Not used when serviceClient is set. | StorageSharedKeyCredential | ||
How the client authenticates when serviceClient is not set. SHARED_ACCOUNT_KEY uses accountName and accessKey, or the credentials option if it is set. SHARED_KEY_CREDENTIAL uses the credentials option. AZURE_SAS uses sasToken. AZURE_IDENTITY uses azureClientId, azureClientSecret and azureTenantId when all three are set, and otherwise the DefaultAzureCredential of azure-identity, which takes the identity from environment variables, a managed identity or a developer tool login. If not set, SHARED_KEY_CREDENTIAL is used when credentials is set, and otherwise AZURE_IDENTITY. Enum values:
| AZURE_IDENTITY | CredentialType | |
The number of bytes to read from the blob, from blobOffset, for the consumer and for getBlob, downloadBlobToFile and getPageBlobRanges. If not set, the range goes to the end of the blob. Must be 0 or more. | Long | ||
The directory to download blobs into. When it is set, the consumer downloads each blob into a file of this directory, named after the blob, and the body is that java.io.File instead of a stream. downloadBlobToFile requires it, and the CamelAzureStorageBlobFileDir header replaces it. A file that already exists is replaced. | String | ||
Whether the producer acquires a lease on the blob before uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob, createPageBlob, uploadPageBlob, resizePageBlob and clearPageBlob, and releases it afterwards, so that no other client writes the blob in the meantime. No lease is acquired when the CamelAzureStorageBlobRequestCondition header holds a lease ID. The blob must exist. The CamelAzureStorageBlobLeaseBlob header replaces this option. | false | boolean | |
The duration in seconds of the lease that leaseBlob acquires: from 15 to 60, or -1 for a lease that does not expire. The CamelAzureStorageBlobLeaseDurationInSeconds header replaces this option. | 60 | Integer | |
The number of blobs per page, at most 5000, that the service returns when the consumer, listBlobs, listBlobVersions or findBlobsByTags list blobs. The producer still returns the blobs of all pages. If not set, the service returns up to 5000 per page, and the consumer asks for maxMessagesPerPoll blobs per page when maxMessagesPerPoll is set and regex is not. The CamelAzureStorageBlobMaxResultsPerPage header replaces this option for the producer. | Integer | ||
How many more times the Azure SDK requests the rest of the blob, from where it stopped, when reading the content of a download fails: for getBlob with an OutputStream body, downloadBlobToFile and the consumer with fileDir. The default 0 turns these retries off, rather than the 5 retries of the SDK. Must be 0 or more. | 0 | int | |
List only the blobs whose names start with this prefix: the consumer, listBlobs and listBlobVersions. Not used when regex is set. With removePrefixOnMove, it is also the prefix that moveAfterRead removes. The CamelAzureStorageBlobPrefix header replaces this option for the producer. | String | ||
List only the blobs whose whole names match this Java regular expression: the consumer, listBlobs and listBlobVersions. The blobs are listed and then filtered on the client. When it is set, the prefix option is not used. The CamelAzureStorageBlobRegex header replaces this option for the producer. | String | ||
Autowired To use a custom com.azure.storage.blob.BlobServiceClient for the requests to the Blob Storage service. When this option is set or autowired, the client brings the address and the authentication, and the accountName, credentialType, accessKey, credentials, sasToken, azureClientId, azureClientSecret and azureTenantId options are not used to connect. | BlobServiceClient | ||
The ID of the blob snapshot to read instead of the blob itself, for the consumer and for getBlob, downloadBlobToFile and downloadLink. The CamelAzureStorageBlobSnapshotId header replaces this option for the producer. | String | ||
The time, for example PT30S or 30s, within which each request to the Blob Storage service must complete, or it fails with an exception. If not set, only the timeouts of the HTTP client apply. It does not apply to reading the blob as a stream (getBlob without an OutputStream body, and the consumer without fileDir), to copyBlob and to getChangeFeed, nor to the delete of deleteAfterRead. For moveAfterRead it is how long the consumer waits for the copy, 5 minutes if not set. The CamelAzureStorageBlobTimeout header replaces this option for the producer. | Duration | ||
The ID of the blob version to read instead of the current version, for the consumer and for getBlob, downloadBlobToFile and downloadLink. The storage account must have blob versioning enabled. The CamelAzureStorageBlobVersionId header replaces this option for the producer. | String | ||
Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | |
Delete each blob from the container once its exchange is complete. If the exchange fails, the blob is not deleted. If false and moveAfterRead is false, the consumer reads the same blobs again in each poll, so use the Idempotent Consumer EIP to filter out duplicates, for example on the CamelAzureStorageBlobBlobName header. | false | boolean | |
The text that moveAfterRead puts before the name of the blob, to name the moved blob. | String | ||
The text that moveAfterRead appends to the name of the blob, to name the moved blob. | String | ||
The container that moveAfterRead moves the blobs to. Required when moveAfterRead is true. | String | ||
Maximum number of blobs to retrieve during one consumer polling cycle. A value of 0 or less means unlimited. | 0 | int | |
Move each blob to destinationContainer, in the same storage account, once its exchange is complete: the blob is copied and then deleted from the container, also when deleteAfterRead is false. If the exchange or the copy fails, the blob stays where it is and is read again. | false | boolean | |
Remove the contents of the prefix configuration string from the new blob name before moving. For example, if prefix is set to 'notify/' and the destinationBlobPrefix is set to 'archive/', a blob with a name of 'notify/example.txt' will be moved to 'archive/example.txt', rather than the default behavior where the new name is 'archive/notify/example.txt'. Only applicable when moveAfterRead is true. | false | boolean | |
The sequence number of the page blob that createPageBlob creates, a value of 0 or more that the application can use to track requests. The service uses 0 if not set. The CamelAzureStorageBlobSequenceNumber header replaces this option. | 0 | Long | |
Which blocks of the block blob getBlobBlockList returns: COMMITTED, UNCOMMITTED or ALL. The CamelAzureStorageBlobBlockListType header replaces this option. Enum values:
| COMMITTED | BlockListType | |
The size in bytes of each block that uploadBlockBlobChunked stages, from 1 byte to 4000 MiB, when the data is larger than maxSingleUploadSize. If not set, the Azure SDK uses 4 MiB, or 8 MiB for a file larger than 100 MiB. Not used when the CamelAzureStorageBlobParallelTransferOptions header is set. The CamelAzureStorageBlobBlockSize header replaces this option. | Long | ||
A com.azure.core.util.Context that getChangeFeed passes through the HTTP pipeline of the Azure SDK. Only used when changeFeedStartTime or changeFeedEndTime is set. The CamelAzureStorageBlobContext header replaces this option. | Context | ||
The time until which getChangeFeed returns the events of the change feed. The change feed is stored by the hour, so events of the next hour can also be returned, and events of this hour can be missing: round the end time up to the hour to get all of them. The CamelAzureStorageBlobChangeFeedEndTime header replaces this option. | OffsetDateTime | ||
The time from which getChangeFeed returns the events of the change feed. The change feed is stored by the hour, so events of the previous hour can also be returned, and events of this hour can be missing: round the start time down to the hour to get all of them. If neither this option nor changeFeedEndTime is set, getChangeFeed returns all events. The CamelAzureStorageBlobChangeFeedStartTime header replaces this option. | OffsetDateTime | ||
Whether uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob and uploadPageBlob close the input stream of the message body after the upload. | true | boolean | |
Whether stageBlockBlobList only stages the blocks, to be committed later with commitBlobBlockList. If false, stageBlockBlobList commits the staged blocks right away, so the blob then consists of these blocks only. The CamelAzureStorageBlobCommitBlobBlockListLater header replaces this option. | true | boolean | |
Whether commitAppendBlob first creates the append blob if it does not exist. The CamelAzureStorageBlobCreateAppendBlob header replaces this option. | true | boolean | |
Whether uploadPageBlob first creates the page blob if it does not exist, as createPageBlob does. The CamelAzureStorageBlobCreatePageBlob header replaces this option. | true | boolean | |
How long, in milliseconds, the link that downloadLink generates stays valid. It is rounded down to whole seconds. If not set, the link is valid for 1 hour. The CamelAzureStorageBlobDownloadLinkExpiration header replaces this option. | Long | ||
Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean | |
The maximum number of requests that uploadBlockBlobChunked sends in parallel, 1 or more. If not set, the Azure SDK uses 8. Not used when the CamelAzureStorageBlobParallelTransferOptions header is set. The CamelAzureStorageBlobMaxConcurrency header replaces this option. | Integer | ||
The size in bytes, from 1 byte to 5000 MiB, up to which uploadBlockBlobChunked uploads the data in a single request. Larger data is uploaded in blocks of blockSize. If not set, the Azure SDK uses 256 MiB. Not used when the CamelAzureStorageBlobParallelTransferOptions header is set. The CamelAzureStorageBlobMaxSingleUploadSize header replaces this option. | Long | ||
The operation that the producer performs. The CamelAzureStorageBlobOperation header replaces this option. If neither is set, the producer performs listBlobContainers. Enum values:
| listBlobContainers | BlobOperationsDefinition | |
The size in bytes of the page blob that createPageBlob creates, or that resizePageBlob sets: a multiple of 512, up to 8 TiB. When the CamelAzureStorageBlobPageBlobRange header is set, the length of that range is the size instead. The CamelAzureStorageBlobPageBlobSize header replaces this option. | 512 | Long | |
Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | |
Used for enabling or disabling all consumer based health checks from this component. | true | boolean | |
Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true. | true | boolean | |
The account key of the storage account, which authenticates the client together with accountName when credentialType is SHARED_ACCOUNT_KEY, for which it is required. Not used when the credentials option or the serviceClient option is set. | String | ||
The client ID of the Microsoft Entra application that authenticates the client when credentialType is AZURE_IDENTITY, together with azureClientSecret and azureTenantId: set all three, or none to use the DefaultAzureCredential. | String | ||
The client secret of the Microsoft Entra application that authenticates the client when credentialType is AZURE_IDENTITY, together with azureClientId and azureTenantId: set all three, or none to use the DefaultAzureCredential. | String | ||
The ID of the Microsoft Entra tenant of the application that authenticates the client when credentialType is AZURE_IDENTITY, together with azureClientId and azureClientSecret: set all three, or none to use the DefaultAzureCredential. | String | ||
The shared access signature (SAS) token that authenticates the client when credentialType is AZURE_SAS. Not used when serviceClient is set. | String | ||
The account key of the storage account of the source blob of copyBlob, which signs a short-lived read-only SAS for the source blob. | String |
Endpoint Options
The Azure Storage Blob Service endpoint is configured using URI syntax:
azure-storage-blob:accountName/containerName
With the following path and query parameters:
Path Parameters
| Name | Description | Default | Type |
|---|---|---|---|
The name of the Azure Storage account, which gives the address https://accountName.blob.core.windows.net of its Blob Storage service. If the credentials option is set, the account name of those credentials gives the address instead. Not used when serviceClient is set. | String | ||
The name of the blob container. Required for the consumer and for each producer operation on a container or a blob. The CamelAzureStorageBlobBlobContainerName header replaces this option for the producer. | String |
Query Parameters
| Name | Description | Default | Type |
|---|---|---|---|
The name of the blob. With it, the consumer reads only this blob, in each poll, and without it the consumer reads all the blobs of the container. The producer requires it for each operation on a blob, and the CamelAzureStorageBlobBlobName header replaces it. For copyBlob it is the name of both the source blob and the blob that the copy creates. | String | ||
The position in bytes of the first byte to read from the blob, for the consumer and for getBlob, downloadBlobToFile and getPageBlobRanges. Must be 0 or more. | 0 | long | |
Not used: when the endpoint starts, it replaces this client with the serviceClient option, or with a client that it creates from the other options. Use serviceClient to set the client. | BlobServiceClient | ||
The type of blob, which only changes the range that getBlob, downloadBlobToFile and getPageBlobRanges read: with pageblob, the CamelAzureStorageBlobPageBlobRange header, if set, gives the range instead of blobOffset and dataCount. The operation decides which type of blob it creates or writes. Enum values:
| blockblob | BlobType | |
Whether the consumer and getBlob close the stream of the blob content: the InputStream body when the exchange completes, or the OutputStream body that getBlob writes into once the download is done. If false, the route must close it. | true | boolean | |
Autowired To use a com.azure.storage.common.StorageSharedKeyCredential, which holds the account name and an account key of the storage account, when credentialType is SHARED_KEY_CREDENTIAL or SHARED_ACCOUNT_KEY. When it is set, its account name gives the address of the service, and the accountName and accessKey options are not used to authenticate. Not used when serviceClient is set. | StorageSharedKeyCredential | ||
How the client authenticates when serviceClient is not set. SHARED_ACCOUNT_KEY uses accountName and accessKey, or the credentials option if it is set. SHARED_KEY_CREDENTIAL uses the credentials option. AZURE_SAS uses sasToken. AZURE_IDENTITY uses azureClientId, azureClientSecret and azureTenantId when all three are set, and otherwise the DefaultAzureCredential of azure-identity, which takes the identity from environment variables, a managed identity or a developer tool login. If not set, SHARED_KEY_CREDENTIAL is used when credentials is set, and otherwise AZURE_IDENTITY. Enum values:
| AZURE_IDENTITY | CredentialType | |
The number of bytes to read from the blob, from blobOffset, for the consumer and for getBlob, downloadBlobToFile and getPageBlobRanges. If not set, the range goes to the end of the blob. Must be 0 or more. | Long | ||
The directory to download blobs into. When it is set, the consumer downloads each blob into a file of this directory, named after the blob, and the body is that java.io.File instead of a stream. downloadBlobToFile requires it, and the CamelAzureStorageBlobFileDir header replaces it. A file that already exists is replaced. | String | ||
Whether the producer acquires a lease on the blob before uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob, createPageBlob, uploadPageBlob, resizePageBlob and clearPageBlob, and releases it afterwards, so that no other client writes the blob in the meantime. No lease is acquired when the CamelAzureStorageBlobRequestCondition header holds a lease ID. The blob must exist. The CamelAzureStorageBlobLeaseBlob header replaces this option. | false | boolean | |
The duration in seconds of the lease that leaseBlob acquires: from 15 to 60, or -1 for a lease that does not expire. The CamelAzureStorageBlobLeaseDurationInSeconds header replaces this option. | 60 | Integer | |
The number of blobs per page, at most 5000, that the service returns when the consumer, listBlobs, listBlobVersions or findBlobsByTags list blobs. The producer still returns the blobs of all pages. If not set, the service returns up to 5000 per page, and the consumer asks for maxMessagesPerPoll blobs per page when maxMessagesPerPoll is set and regex is not. The CamelAzureStorageBlobMaxResultsPerPage header replaces this option for the producer. | Integer | ||
How many more times the Azure SDK requests the rest of the blob, from where it stopped, when reading the content of a download fails: for getBlob with an OutputStream body, downloadBlobToFile and the consumer with fileDir. The default 0 turns these retries off, rather than the 5 retries of the SDK. Must be 0 or more. | 0 | int | |
List only the blobs whose names start with this prefix: the consumer, listBlobs and listBlobVersions. Not used when regex is set. With removePrefixOnMove, it is also the prefix that moveAfterRead removes. The CamelAzureStorageBlobPrefix header replaces this option for the producer. | String | ||
List only the blobs whose whole names match this Java regular expression: the consumer, listBlobs and listBlobVersions. The blobs are listed and then filtered on the client. When it is set, the prefix option is not used. The CamelAzureStorageBlobRegex header replaces this option for the producer. | String | ||
Autowired To use a custom com.azure.storage.blob.BlobServiceClient for the requests to the Blob Storage service. When this option is set or autowired, the client brings the address and the authentication, and the accountName, credentialType, accessKey, credentials, sasToken, azureClientId, azureClientSecret and azureTenantId options are not used to connect. | BlobServiceClient | ||
The ID of the blob snapshot to read instead of the blob itself, for the consumer and for getBlob, downloadBlobToFile and downloadLink. The CamelAzureStorageBlobSnapshotId header replaces this option for the producer. | String | ||
The time, for example PT30S or 30s, within which each request to the Blob Storage service must complete, or it fails with an exception. If not set, only the timeouts of the HTTP client apply. It does not apply to reading the blob as a stream (getBlob without an OutputStream body, and the consumer without fileDir), to copyBlob and to getChangeFeed, nor to the delete of deleteAfterRead. For moveAfterRead it is how long the consumer waits for the copy, 5 minutes if not set. The CamelAzureStorageBlobTimeout header replaces this option for the producer. | Duration | ||
The ID of the blob version to read instead of the current version, for the consumer and for getBlob, downloadBlobToFile and downloadLink. The storage account must have blob versioning enabled. The CamelAzureStorageBlobVersionId header replaces this option for the producer. | String | ||
Delete each blob from the container once its exchange is complete. If the exchange fails, the blob is not deleted. If false and moveAfterRead is false, the consumer reads the same blobs again in each poll, so use the Idempotent Consumer EIP to filter out duplicates, for example on the CamelAzureStorageBlobBlobName header. | false | boolean | |
The text that moveAfterRead puts before the name of the blob, to name the moved blob. | String | ||
The text that moveAfterRead appends to the name of the blob, to name the moved blob. | String | ||
The container that moveAfterRead moves the blobs to. Required when moveAfterRead is true. | String | ||
Maximum number of blobs to retrieve during one consumer polling cycle. A value of 0 or less means unlimited. | 0 | int | |
Move each blob to destinationContainer, in the same storage account, once its exchange is complete: the blob is copied and then deleted from the container, also when deleteAfterRead is false. If the exchange or the copy fails, the blob stays where it is and is read again. | false | boolean | |
Remove the contents of the prefix configuration string from the new blob name before moving. For example, if prefix is set to 'notify/' and the destinationBlobPrefix is set to 'archive/', a blob with a name of 'notify/example.txt' will be moved to 'archive/example.txt', rather than the default behavior where the new name is 'archive/notify/example.txt'. Only applicable when moveAfterRead is true. | false | boolean | |
If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean | |
Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | |
To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | ExceptionHandler | ||
Sets the exchange pattern when the consumer creates an exchange. Enum values:
| ExchangePattern | ||
A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. | PollingConsumerPollStrategy | ||
The sequence number of the page blob that createPageBlob creates, a value of 0 or more that the application can use to track requests. The service uses 0 if not set. The CamelAzureStorageBlobSequenceNumber header replaces this option. | 0 | Long | |
Which blocks of the block blob getBlobBlockList returns: COMMITTED, UNCOMMITTED or ALL. The CamelAzureStorageBlobBlockListType header replaces this option. Enum values:
| COMMITTED | BlockListType | |
The size in bytes of each block that uploadBlockBlobChunked stages, from 1 byte to 4000 MiB, when the data is larger than maxSingleUploadSize. If not set, the Azure SDK uses 4 MiB, or 8 MiB for a file larger than 100 MiB. Not used when the CamelAzureStorageBlobParallelTransferOptions header is set. The CamelAzureStorageBlobBlockSize header replaces this option. | Long | ||
A com.azure.core.util.Context that getChangeFeed passes through the HTTP pipeline of the Azure SDK. Only used when changeFeedStartTime or changeFeedEndTime is set. The CamelAzureStorageBlobContext header replaces this option. | Context | ||
The time until which getChangeFeed returns the events of the change feed. The change feed is stored by the hour, so events of the next hour can also be returned, and events of this hour can be missing: round the end time up to the hour to get all of them. The CamelAzureStorageBlobChangeFeedEndTime header replaces this option. | OffsetDateTime | ||
The time from which getChangeFeed returns the events of the change feed. The change feed is stored by the hour, so events of the previous hour can also be returned, and events of this hour can be missing: round the start time down to the hour to get all of them. If neither this option nor changeFeedEndTime is set, getChangeFeed returns all events. The CamelAzureStorageBlobChangeFeedStartTime header replaces this option. | OffsetDateTime | ||
Whether uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob and uploadPageBlob close the input stream of the message body after the upload. | true | boolean | |
Whether stageBlockBlobList only stages the blocks, to be committed later with commitBlobBlockList. If false, stageBlockBlobList commits the staged blocks right away, so the blob then consists of these blocks only. The CamelAzureStorageBlobCommitBlobBlockListLater header replaces this option. | true | boolean | |
Whether commitAppendBlob first creates the append blob if it does not exist. The CamelAzureStorageBlobCreateAppendBlob header replaces this option. | true | boolean | |
Whether uploadPageBlob first creates the page blob if it does not exist, as createPageBlob does. The CamelAzureStorageBlobCreatePageBlob header replaces this option. | true | boolean | |
How long, in milliseconds, the link that downloadLink generates stays valid. It is rounded down to whole seconds. If not set, the link is valid for 1 hour. The CamelAzureStorageBlobDownloadLinkExpiration header replaces this option. | Long | ||
The maximum number of requests that uploadBlockBlobChunked sends in parallel, 1 or more. If not set, the Azure SDK uses 8. Not used when the CamelAzureStorageBlobParallelTransferOptions header is set. The CamelAzureStorageBlobMaxConcurrency header replaces this option. | Integer | ||
The size in bytes, from 1 byte to 5000 MiB, up to which uploadBlockBlobChunked uploads the data in a single request. Larger data is uploaded in blocks of blockSize. If not set, the Azure SDK uses 256 MiB. Not used when the CamelAzureStorageBlobParallelTransferOptions header is set. The CamelAzureStorageBlobMaxSingleUploadSize header replaces this option. | Long | ||
The operation that the producer performs. The CamelAzureStorageBlobOperation header replaces this option. If neither is set, the producer performs listBlobContainers. Enum values:
| listBlobContainers | BlobOperationsDefinition | |
The size in bytes of the page blob that createPageBlob creates, or that resizePageBlob sets: a multiple of 512, up to 8 TiB. When the CamelAzureStorageBlobPageBlobRange header is set, the length of that range is the size instead. The CamelAzureStorageBlobPageBlobSize header replaces this option. | 512 | Long | |
Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean | |
The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. | int | ||
The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. | int | ||
To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured. | int | ||
Milliseconds before the next poll. | 500 | long | |
If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages. | false | boolean | |
How long a poll may run before the health check of the consumer reports DOWN. The health check is otherwise based on the polls that are done, so it stays UP while a poll hangs, for example on a read without timeout from a connection that went silent. A poll includes routing the messages it polled, so set this above the longest poll you expect. The poll is not interrupted. The value is in millis (not affected by timeUnit). The default 0 turns this off. | 0 | long | |
Milliseconds before the first poll starts. | 1000 | long | |
Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever. | 0 | long | |
The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. Enum values:
| TRACE | LoggingLevel | |
Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. | ScheduledExecutorService | ||
To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler. | none | Object | |
To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. This is a multi-value option with prefix: scheduler. | Map | ||
Whether the scheduler should be auto started. | true | boolean | |
Time unit for initialDelay and delay options. Enum values:
| MILLISECONDS | TimeUnit | |
Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. | true | boolean | |
The account key of the storage account, which authenticates the client together with accountName when credentialType is SHARED_ACCOUNT_KEY, for which it is required. Not used when the credentials option or the serviceClient option is set. | String | ||
The client ID of the Microsoft Entra application that authenticates the client when credentialType is AZURE_IDENTITY, together with azureClientSecret and azureTenantId: set all three, or none to use the DefaultAzureCredential. | String | ||
The client secret of the Microsoft Entra application that authenticates the client when credentialType is AZURE_IDENTITY, together with azureClientId and azureTenantId: set all three, or none to use the DefaultAzureCredential. | String | ||
The ID of the Microsoft Entra tenant of the application that authenticates the client when credentialType is AZURE_IDENTITY, together with azureClientId and azureClientSecret: set all three, or none to use the DefaultAzureCredential. | String | ||
The shared access signature (SAS) token that authenticates the client when credentialType is AZURE_SAS. Not used when serviceClient is set. | String | ||
The account key of the storage account of the source blob of copyBlob, which signs a short-lived read-only SAS for the source blob. | String |
Message Headers
The Azure Storage Blob Service component supports the following message header(s), which is/are listed below:
| Name | Description | Default | Type |
|---|---|---|---|
CamelAzureStorageBlobOperation (producer) Constant: | The operation that the producer performs. It replaces the operation option. Enum values:
| BlobOperationsDefinition | |
CamelAzureStorageBlobHttpHeaders (producer) Constant: | The HTTP properties of the blob, such as its content type, content encoding and cache control, as a com.azure.storage.blob.models.BlobHttpHeaders, which uploadBlockBlob, uploadBlockBlobChunked, commitBlobBlockList, createAppendBlob and createPageBlob set on the blob. commitAppendBlob and uploadPageBlob use it when they create the blob. | BlobHttpHeaders | |
CamelAzureStorageBlobETag (consumer) Constant: | The ETag of the blob. | String | |
CamelAzureStorageBlobCreationTime (consumer) Constant: | Creation time of the blob. | OffsetDateTime | |
CamelAzureStorageBlobLastModified (consumer) Constant: | Datetime when the blob was last modified. | OffsetDateTime | |
CamelMessageTimestamp (consumer) Constant: | The time the blob was last modified, in milliseconds since the epoch, with second precision (the last three digits are always 0). Set together with CamelAzureStorageBlobLastModified. | long | |
CamelAzureStorageBlobContentType (consumer) Constant: | Content type specified for the blob. | String | |
CamelAzureStorageBlobContentMD5 (common) Constant: | The MD5 hash of the content. The consumer, getBlob and downloadBlobToFile set it to the MD5 hash of the blob, and the upload operations to the hash the service returns. For uploadBlockBlob, stageBlockBlobList, commitAppendBlob and uploadPageBlob, the service checks the uploaded content against it and the request fails if they differ. For getBlob with an OutputStream body and downloadBlobToFile, any value makes the service return the MD5 hash of the range read, which must then be at most 4 MiB. | byte[] | |
CamelAzureStorageBlobContentEncoding (consumer) Constant: | Content encoding specified for the blob. | String | |
CamelAzureStorageBlobContentDisposition (consumer) Constant: | Content disposition specified for the blob. | String | |
CamelAzureStorageBlobContentLanguage (consumer) Constant: | Content language specified for the blob. | String | |
CamelAzureStorageBlobCacheControl (consumer) Constant: | Cache control specified for the blob. | String | |
CamelAzureStorageBlobBlobSize (consumer) Constant: | The size of the blob in bytes. | long | |
CamelAzureStorageBlobBlobUploadSize (producer) Constant: | The length in bytes of the stream in the message body, for uploadBlockBlob, uploadBlockBlobChunked and commitAppendBlob, when the length cannot be known without reading the stream. Not used for a File or byte[] body. The producer removes the header once it read it. | long | |
CamelAzureStorageBlobSequenceNumber (common) Constant: | The sequence number of the page blob. createPageBlob, and uploadPageBlob when it creates the blob, give it to the blob they create, a value of 0 or more, which replaces the blobSequenceNumber option. The consumer, getBlob, downloadBlobToFile and the page blob operations set it to the current sequence number of the blob. | Long | |
CamelAzureStorageBlobBlobType (consumer) Constant: | The type of the blob. Enum values:
| BlobType | |
CamelAzureStorageBlobLeaseBlob (common) Constant: | Whether the producer acquires a lease on the blob before uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob, createPageBlob, uploadPageBlob, resizePageBlob and clearPageBlob, and releases it afterwards. It replaces the leaseBlob option. | boolean | |
CamelAzureStorageBlobLeaseDurationInSeconds (common) Constant: | The duration in seconds of the lease that leaseBlob acquires: from 15 to 60, or -1 for a lease that does not expire. It replaces the leaseDurationInSeconds option. | Integer | |
CamelAzureStorageBlobLeaseStatus (consumer) Constant: | Status of the lease on the blob. Enum values:
| LeaseStatusType | |
CamelAzureStorageBlobLeaseState (consumer) Constant: | State of the lease on the blob. Enum values:
| LeaseStateType | |
CamelAzureStorageBlobLeaseDuration (consumer) Constant: | Type of lease on the blob. Enum values:
| LeaseDurationType | |
CamelAzureStorageBlobCopyId (consumer) Constant: | Identifier of the last copy operation performed on the blob. | String | |
CamelAzureStorageBlobCopyStatus (consumer) Constant: | Status of the last copy operation performed on the blob. Enum values:
| CopyStatusType | |
CamelAzureStorageBlobCopySource (consumer) Constant: | Source of the last copy operation performed on the blob. | String | |
CamelAzureStorageBlobCopyProgress (consumer) Constant: | Progress of the last copy operation performed on the blob. | String | |
CamelAzureStorageBlobCopyCompletionTime (consumer) Constant: | Datetime when the last copy operation on the blob completed. | OffsetDateTime | |
CamelAzureStorageBlobCopyStatusDescription (consumer) Constant: | Description of the last copy operation on the blob. | String | |
CamelAzureStorageBlobCopyDestinationSnapshot (consumer) Constant: | Snapshot identifier of the last incremental copy snapshot for the blob. | String | |
CamelAzureStorageBlobIsServerEncrypted (consumer) Constant: | Flag indicating if the blob’s content is encrypted on the server. | boolean | |
CamelAzureStorageBlobIsIncrementalCopy (consumer) Constant: | Flag indicating if the blob was incrementally copied. | boolean | |
CamelAzureStorageBlobAccessTier (common) Constant: | The access tier of the blob, such as HOT, COOL, COLD or ARCHIVE. uploadBlockBlob, uploadBlockBlobChunked and commitBlobBlockList give it to the blob they write, and setBlobTier sets it, with the message body used when the header is not set. The consumer, getBlob, downloadBlobToFile and setBlobTier set it to the access tier of the blob. | AccessTier | |
CamelAzureStorageBlobIsAccessTierInferred (consumer) Constant: | Flag indicating if the access tier of the blob was inferred from properties of the blob. | boolean | |
CamelAzureStorageBlobArchiveStatus (consumer) Constant: | Archive status of the blob. | ArchiveStatus | |
CamelAzureStorageBlobEncryptionKeySha256 (consumer) Constant: | The SHA-256 hash of the customer-provided key that encrypts the blob, when the blob is encrypted with such a key. Set by the consumer and the operations that read the blob or its properties, and by the operations that upload a block blob or append to a blob. | String | |
CamelAzureStorageBlobEncryptionScope (producer) Constant: | The name of the encryption scope that encrypts the uploaded content, when the blob uses one. Set by the operations that upload a block blob, append to a blob or upload pages. | String | |
CamelAzureStorageBlobaccessTierChangeTime (consumer) Constant: | Datetime when the access tier of the blob last changed. | OffsetDateTime | |
CamelAzureStorageBlobMetadata (common) Constant: | The metadata, as a map of strings, that createBlobContainer gives to the container, or that uploadBlockBlob, uploadBlockBlobChunked, commitBlobBlockList, createAppendBlob, createPageBlob and createBlobSnapshot give to the blob or the snapshot. The consumer, getBlob and downloadBlobToFile set it to the metadata of the blob. | Map | |
CamelAzureStorageBlobCommittedBlockCount (consumer) Constant: | The number of committed blocks of the append blob. The consumer, getBlob, downloadBlobToFile and commitAppendBlob set it. | Integer | |
CamelAzureStorageBlobAppendOffset (consumer) Constant: | The offset in the append blob at which commitAppendBlob appended the block. | String | |
CamelAzureStorageBlobRawHttpHeaders (consumer) Constant: | The HTTP headers of the response of the Blob Storage service, as a com.azure.core.http.HttpHeaders, which most producer operations set. | HttpHeaders | |
CamelAzureStorageBlobFileName (consumer) Constant: | The path of the file that downloadBlobToFile, or the consumer with fileDir, downloaded the blob into. | String | |
CamelAzureStorageBlobDownloadLink (consumer) Constant: | The URL of the blob, with a read-only SAS, that downloadLink generates. | String | |
CamelAzureStorageBlobListBlobOptions (producer) Constant: | A com.azure.storage.blob.models.ListBlobsOptions for listBlobs and listBlobVersions. In effect it is not used: they replace its details, prefix and page size with the CamelAzureStorageBlobListDetails header, the prefix option and the maxResultsPerPage option. | ListBlobsOptions | |
CamelAzureStorageBlobListDetails (producer) Constant: | Which extra data listBlobs and listBlobVersions return for each blob, such as metadata, tags, snapshots, versions or deleted blobs, as a com.azure.storage.blob.models.BlobListDetails. listBlobVersions always adds the versions. | BlobListDetails | |
CamelAzureStorageBlobPrefix (producer) Constant: | List only the blobs whose names start with this prefix, for listBlobs and listBlobVersions. It replaces the prefix option, and is not used when a regex is set. | String | |
CamelAzureStorageBlobRegex (producer) Constant: | List only the blobs whose whole names match this Java regular expression, for listBlobs and listBlobVersions. It replaces the regex option. When it is set, no prefix is used. | String | |
CamelAzureStorageBlobMaxResultsPerPage (producer) Constant: | The number of blobs per page, at most 5000, that the service returns for listBlobs, listBlobVersions and findBlobsByTags. They still return the blobs of all pages. It replaces the maxResultsPerPage option. | Integer | |
CamelAzureStorageBlobTimeout (producer) Constant: | The time within which each request of the producer to the Blob Storage service must complete, or it fails with an exception. It replaces the timeout option. | Duration | |
CamelAzureStorageBlobPublicAccessType (producer) Constant: | The anonymous public read access of the container that createBlobContainer creates: CONTAINER for the container and its blobs, or BLOB for the blobs only. If not set, the container is private. | PublicAccessType | |
CamelAzureStorageBlobRequestCondition (producer) Constant: | The conditions, as a com.azure.storage.blob.models.BlobRequestConditions, that the blob or container must meet for the request to succeed: ETag, modification time, blob tags and lease ID. Used by deleteBlobContainer and by most blob operations, while stageBlockBlobList, getBlobBlockList and setBlobTier only use its lease ID. | BlobRequestConditions | |
CamelAzureStorageBlobBlobContainerName (producer) Constant: | The name of the container for the producer. It replaces the containerName option. | String | |
CamelAzureStorageBlobBlobName (common) Constant: | The name of the blob. The consumer sets it to the name of the blob it read. For the producer it replaces the blobName option. | String | |
CamelAzureStorageBlobConsumedContainerName (consumer) Constant: | The name of the container the blob was consumed from. It is not the CamelAzureStorageBlobBlobContainerName header, which overrides the container of a producer. | String | |
CamelAzureStorageBlobFileDir (producer) Constant: | The directory that downloadBlobToFile downloads the blob into. It replaces the fileDir option. | String | |
CamelAzureStorageBlobPageBlobRange (producer) Constant: | A range of bytes of the page blob, as a com.azure.storage.blob.models.PageRange, whose start is a multiple of 512 and whose end is a multiple of 512 minus 1, such as 0-511 or 512-1023. uploadPageBlob writes, and clearPageBlob clears, this range, and both require it. For createPageBlob and resizePageBlob the length of the range is the size of the blob. With blobType pageblob, it is the range that getBlob, downloadBlobToFile and getPageBlobRanges read, instead of blobOffset and dataCount. | PageRange | |
CamelAzureStorageBlobPageBlobSize (producer) Constant: | The size in bytes of the page blob that createPageBlob creates, or that resizePageBlob sets: a multiple of 512, up to 8 TiB. It replaces the pageBlobSize option, and is not used when the CamelAzureStorageBlobPageBlobRange header is set. | Long | |
CamelAzureStorageBlobCommitBlobBlockListLater (producer) Constant: | Whether stageBlockBlobList only stages the blocks. If false, it commits them right away. It replaces the commitBlockListLater option. | boolean | |
CamelAzureStorageBlobBlockListType (producer) Constant: | Which blocks of the block blob getBlobBlockList returns: COMMITTED, UNCOMMITTED or ALL. It replaces the blockListType option. Enum values:
| BlockListType | |
CamelAzureStorageBlobCreateAppendBlob (producer) Constant: | Whether commitAppendBlob first creates the append blob if it does not exist. It replaces the createAppendBlob option. | boolean | |
CamelAzureStorageBlobCreatePageBlob (producer) Constant: | Whether uploadPageBlob first creates the page blob if it does not exist. It replaces the createPageBlob option. | boolean | |
CamelAzureStorageBlobDeleteSnapshotsOptionType (producer) Constant: | What deleteBlob does with the snapshots of the blob: INCLUDE deletes the blob and its snapshots, ONLY deletes the snapshots only. If not set, deleteBlob deletes the blob, which fails if the blob has snapshots. Do not set it when the blob to delete is a snapshot. Enum values:
| DeleteSnapshotsOptionType | |
CamelAzureStorageBlobListBlobContainersOptions (producer) Constant: | The options of listBlobContainers, as a com.azure.storage.blob.models.ListBlobContainersOptions: the prefix of the names of the containers to list, whether to include their metadata or deleted containers, and the number of containers per page. If not set, listBlobContainers lists all containers without their metadata. | ListBlobContainersOptions | |
CamelAzureStorageBlobParallelTransferOptions (producer) Constant: | The block size, maximum concurrency and maximum single upload size of a parallel transfer, as a com.azure.storage.blob.models.ParallelTransferOptions: for downloadBlobToFile, and for uploadBlockBlobChunked, where it replaces the blockSize, maxConcurrency and maxSingleUploadSize options. | ParallelTransferOptions | |
CamelAzureStorageBlobFilePath (producer) Constant: | The path of the local file that uploadBlockBlobChunked uploads, instead of the message body. | String | |
CamelAzureStorageBlobBlockSize (producer) Constant: | The size in bytes of each block that uploadBlockBlobChunked stages, from 1 byte to 4000 MiB. It replaces the blockSize option. | Long | |
CamelAzureStorageBlobMaxConcurrency (producer) Constant: | The maximum number of requests that uploadBlockBlobChunked sends in parallel. It replaces the maxConcurrency option. | Integer | |
CamelAzureStorageBlobMaxSingleUploadSize (producer) Constant: | The size in bytes, from 1 byte to 5000 MiB, up to which uploadBlockBlobChunked uploads the data in a single request. It replaces the maxSingleUploadSize option. | Long | |
CamelAzureStorageBlobDownloadLinkExpiration (producer) Constant: | How long, in milliseconds, the link that downloadLink generates stays valid. It replaces the downloadLinkExpiration option. | Long | |
CamelAzureStorageBlobSourceBlobAccountName (producer) Constant: | The name of the storage account of the source blob of copyBlob, which requires it. | String | |
CamelAzureStorageBlobSourceBlobContainerName (producer) Constant: | The name of the container of the source blob of copyBlob, which requires it. | String | |
CamelAzureStorageBlobChangeFeedStartTime (producer) Constant: | The time from which getChangeFeed returns the events of the change feed. Events of the previous hour can also be returned, and events of this hour can be missing: round the start time down to the hour to get all of them. It replaces the changeFeedStartTime option. | OffsetDateTime | |
CamelAzureStorageBlobChangeFeedEndTime (producer) Constant: | The time until which getChangeFeed returns the events of the change feed. Events of the next hour can also be returned, and events of this hour can be missing: round the end time up to the hour to get all of them. It replaces the changeFeedEndTime option. | OffsetDateTime | |
CamelAzureStorageBlobContext (producer) Constant: | A com.azure.core.util.Context that getChangeFeed passes through the HTTP pipeline of the Azure SDK, when a start or end time is set. It replaces the changeFeedContext option. | Context | |
CamelAzureStorageBlobSnapshotId (common) Constant: | The ID of a blob snapshot. createBlobSnapshot sets it to the ID of the snapshot it created. For getBlob, downloadBlobToFile and downloadLink it is the snapshot to read instead of the blob, and it replaces the snapshotId option. | String | |
CamelAzureStorageBlobVersionId (common) Constant: | The ID of a blob version. For getBlob, downloadBlobToFile and downloadLink it is the version to read instead of the current version, and it replaces the versionId option. The consumer, getBlob and downloadBlobToFile set it to the version of the blob they read, when the storage account has blob versioning enabled. | String | |
CamelAzureStorageBlobIsCurrentVersion (consumer) Constant: | Whether the blob that the consumer, getBlob or downloadBlobToFile read is the current version of the blob. | Boolean | |
CamelAzureStorageBlobTags (common) Constant: | The blob index tags, as a map of strings. setBlobTags sets them on the blob, with the message body used when the header is not set. getBlobTags sets the header to the tags of the blob. | Map | |
CamelAzureStorageBlobTagFilter (producer) Constant: | The SQL-like expression on the blob index tags with which findBlobsByTags finds blobs across the storage account, with the tag names in double quotes and the values in single quotes. If not set, the message body is the expression. | String | |
CamelAzureStorageBlobLegalHold (common) Constant: | Whether the blob has a legal hold, which protects it from changes and deletion until the hold is cleared. setBlobLegalHold sets or clears the legal hold, with the message body used when the header is not set, and then sets the header to the legal hold state that the service returns. | Boolean | |
CamelAzureStorageBlobImmutabilityPolicy (producer) Constant: | The immutability policy, as a com.azure.storage.blob.models.BlobImmutabilityPolicy, that setBlobImmutabilityPolicy sets on the blob. When it is set, the expiry time and mode headers are not used. If not set, a BlobImmutabilityPolicy in the message body is used. | BlobImmutabilityPolicy | |
CamelAzureStorageBlobImmutabilityPolicyExpiryTime (producer) Constant: | The time until which the immutability policy that setBlobImmutabilityPolicy sets protects the blob. Required unless a BlobImmutabilityPolicy is in the message body or in the CamelAzureStorageBlobImmutabilityPolicy header. setBlobImmutabilityPolicy sets it to the expiry time that the service returns. | OffsetDateTime | |
CamelAzureStorageBlobImmutabilityPolicyMode (producer) Constant: | The mode of the immutability policy that setBlobImmutabilityPolicy sets: UNLOCKED, the default, which can still be changed or deleted, or LOCKED, which can only be extended. setBlobImmutabilityPolicy sets it to the mode that the service returns. Enum values:
| BlobImmutabilityPolicyMode | |
CamelAzureStorageBlobRehydratePriority (producer) Constant: | The priority, STANDARD or HIGH, with which setBlobTier rehydrates a blob from the archive tier. Not used when the blob is not in the archive tier. | RehydratePriority |
Message Body
The message body at each side of the Azure Storage Blob Service component: Consumer is the body of the messages the consumer creates, Consumer reply the bodies a consumer that answers its caller can reply with, Producer input the bodies the producer can send or write, and Producer output the body after the producer.
| Side | Body | Description |
|---|---|---|
Consumer |
| The content of the blob, one message per blob: a stream that reads it, or with fileDir the java.io.File it is downloaded to. |
Producer input |
| The content to upload for uploadBlockBlob, commitAppendBlob and uploadPageBlob: text, bytes, a stream or a file; a Map or a List fails: marshal it first. A List of BlobBlock for stageBlockBlobList, and of Block for commitBlobBlockList. getBlob writes into an OutputStream body. The other operations do not use the body, or take their value from a header first: the file of uploadBlockBlobChunked, the tags, the tag filter, the legal hold, the tier and the policy.
|
Producer output |
| A List of the items of the SDK for listBlobContainers, the default, findBlobsByTags, listBlobs, listBlobVersions and getChangeFeed. A stream of the content for getBlob, or the OutputStream body it wrote into; the java.io.File for downloadBlobToFile; true for the operations that create, upload, set or delete, with their results in headers, such as the link of downloadLink.
|
The bodies are the ones with the default options. A side that is not listed is not known, and tooling does not guess it. The carriers, the sides and the tools that use them are described in Message Body Types.
Required information options:
To use this component, you have multiple options to provide the required Azure authentication information:
-
By providing your own BlobServiceClient instance which can be injected into
serviceClient. Note: You don’t need to create a specific client, e.g.: BlockBlobClient, the BlobServiceClient represents the upper level which can be used to retrieve lower level clients. -
Via Azure Identity, when specifying
credentialType=AZURE_IDENTITYand providing required environment variables. This enables service principal (e.g. app registration) authentication with secret/certificate as well as username password. Note that this is the default authentication strategy. -
Via shared storage account key, when specifying
credentialType=SHARED_ACCOUNT_KEYand providingaccountNameandaccessKeyfor your Azure account, this is the simplest way to get started. The accessKey can be generated through your Azure portal. -
Via shared storage account key, when specifying
credentialType=SHARED_KEY_CREDENTIALand providing a StorageSharedKeyCredential instance which can be injected intocredentialsoption. -
Via Azure SAS, when specifying
credentialType=AZURE_SASand providing a SAS Token parameter through thesasTokenparameter.
Usage
For example, to download a blob content from the block blob hello.txt located on the container1 in the camelazure storage account, use the following snippet:
-
Java
-
XML
-
YAML
from("azure-storage-blob://camelazure/container1?blobName=hello.txt&credentialType=SHARED_ACCOUNT_KEY&accessKey=RAW(yourAccessKey)")
.to("file://blobdirectory"); <route>
<from uri="azure-storage-blob://camelazure/container1?blobName=hello.txt&credentialType=SHARED_ACCOUNT_KEY&accessKey=RAW(yourAccessKey)"/>
<to uri="file://blobdirectory"/>
</route> - route:
from:
uri: azure-storage-blob://camelazure/container1
parameters:
blobName: hello.txt
credentialType: SHARED_ACCOUNT_KEY
accessKey: RAW(yourAccessKey)
steps:
- to:
uri: file://blobdirectory Advanced Azure Storage Blob configuration
If your Camel Application is running behind a firewall or if you need to have more control over the BlobServiceClient instance configuration, you can create your own instance:
StorageSharedKeyCredential credential = new StorageSharedKeyCredential("yourAccountName", "yourAccessKey");
String uri = String.format("https://%s.blob.core.windows.net", "yourAccountName");
BlobServiceClient client = new BlobServiceClientBuilder()
.endpoint(uri)
.credential(credential)
.buildClient();
// This is camel context
context.getRegistry().bind("client", client); Then refer to this instance in your Camel azure-storage-blob component configuration:
-
Java
-
XML
-
YAML
from("azure-storage-blob://cameldev/container1?blobName=myblob&serviceClient=#client")
.to("mock:result"); <route>
<from uri="azure-storage-blob://cameldev/container1?blobName=myblob&serviceClient=#client"/>
<to uri="mock:result"/>
</route> - route:
from:
uri: azure-storage-blob://cameldev/container1
parameters:
blobName: myblob
serviceClient: "#client"
steps:
- to:
uri: mock:result Automatic detection of BlobServiceClient client in registry
The component is capable of detecting the presence of an BlobServiceClient bean into the registry. If it’s the only instance of that type, it will be used as the client, and you won’t have to define it as uri parameter, like the example above. This may be really useful for smarter configuration of the endpoint.
Azure Storage Blob Producer operations
Camel Azure Storage Blob component provides a wide range of operations on the producer side:
Operations on the service level
For these operations, accountName is required.
| Operation | Description |
|---|---|
| List the blob containers of the storage account, as a |
| Returns transaction logs of all the changes that occur to the blobs and the blob metadata in your storage account. The change feed provides ordered, guaranteed, durable, immutable, read-only log of these changes. |
| Returns a list of blobs across the storage account whose index tags match the SQL-like filter expression provided via the |
Operations on the container level
For these operations, accountName and containerName are required.
| Operation | Description |
|---|---|
| Create a new container within a storage account. If a container with the same name already exists, the operation fails. |
| Delete the specified container in the storage account. If the container doesn’t exist, the operation fails. |
| Returns a list of blobs in this container, with folder structures flattened. |
| Returns a list of blobs and their versions in this container. Each |
Operations on the blob level
For these operations, accountName, containerName and blobName are required.
| Operation | Blob Type | Description |
|---|---|---|
| Common | Get the content of the blob. You can restrict the output of this operation to a blob range. The content is written to the body when the body is an |
| Common | Delete a blob. |
| Common | Download the blob into a file of the |
| Common | Generate the download link for the specified blob using shared access signatures (SAS). This by default only limits to 1hour of allowed access. However, you can override the default expiration duration through the headers. |
| BlockBlob | Creates a new block blob, or updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with PutBlob; the content of the existing blob is overwritten with the new content. Note: For larger files, use |
| BlockBlob | Creates or updates a block blob with support for large files (up to several GB). Uses chunked parallel uploads for memory efficiency. Accepts File, Path, WrappedFile, or InputStream as body. Configure |
|
| Uploads the specified block to the block blob’s "staging area" to be later committed by a call to commitBlobBlockList. However, in case header |
|
| Write a blob by specifying the list of block IDs that are to make up the blob. To be written as part of a blob, a block must have been successfully written to the server in a prior |
|
| Returns the list of blocks that have been uploaded as part of a block blob using the specified blocklist filter. |
|
| Creates a 0-length append blob. Call commitAppendBlo`b operation to append data to an append blob. |
|
| Commits a new block of data to the end of the existing append blob. In case of header |
|
| Creates a page blob of the specified length. Call |
|
| Write one or more pages to the page blob. The size must be a multiple of 512. In case of header |
|
| Resizes the page blob to the specified size, which must be a multiple of 512. |
|
| Free the specified pages from the page blob. The size of the range must be a multiple of 512. |
|
| Returns the list of valid page ranges for a page blob or snapshot of a page blob. |
|
| Copy a blob from one container to another one, even from different accounts. |
|
| Creates a read-only snapshot of a blob. The snapshot ID is returned in the |
|
| Sets user-defined index tags on a blob. Tags are key-value pairs that can be used to filter and query blobs across containers. Tags can be provided via the |
|
| Retrieves user-defined index tags from a blob. The tags are returned as the message body ( |
|
| Sets a legal hold on a blob. The legal hold flag ( |
|
| Sets a time-based immutability policy on a blob. The policy expiry time ( |
|
| Restores the contents and metadata of a soft-deleted blob and any associated soft-deleted snapshots. Soft delete must be enabled on the storage account for this operation to succeed. |
|
| Sets the access tier of an existing blob. The target tier ( |
Refer to the example section in this page to learn how to use these operations into your camel application.
Sub-Pages
For more details on specific features, see:
-
Producer Operations - All producer operation examples, blob snapshots/versions, and SAS token generation
-
Consumer Examples - Consumer patterns including delete after read and move after read
Important Development Notes
All integration tests use Testcontainers and run by default. Obtaining of Azure accessKey and accountName is needed to be able to run all integration tests using Azure services. In addition to the mocked unit tests, you will need to run the integration tests with every change you make or even client upgrade as the Azure client can break things even on minor versions upgrade. To run the integration tests, on this component directory, run the following maven command:
mvn verify -DaccountName=myacc -DaccessKey=mykey -DcredentialType=SHARED_ACCOUNT_KEY Whereby accountName is your Azure account name and accessKey is the access key being generated from Azure portal.