Camel Components

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, *.yaml files, 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

blobName (common)

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

blobOffset (common)

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

blobType (common)

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

  • appendblob

  • pageblob

blockblob

BlobType

closeStreamAfterRead (common)

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

configuration (common)

The configuration that each endpoint of this component starts from, before the options of the endpoint are applied.

BlobConfiguration

credentials (common)

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

credentialType (common)

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:

  • SHARED_ACCOUNT_KEY

  • SHARED_KEY_CREDENTIAL

  • AZURE_IDENTITY

  • AZURE_SAS

AZURE_IDENTITY

CredentialType

dataCount (common)

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

fileDir (common)

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

leaseBlob (common)

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

leaseDurationInSeconds (common)

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

maxResultsPerPage (common)

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

maxRetryRequests (common)

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

prefix (common)

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

regex (common)

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

serviceClient (common)

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

snapshotId (common)

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

timeout (common)

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

versionId (common)

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

bridgeErrorHandler (consumer)

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

deleteAfterRead (consumer)

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

destinationBlobPrefix (consumer)

The text that moveAfterRead puts before the name of the blob, to name the moved blob.

String

destinationBlobSuffix (consumer)

The text that moveAfterRead appends to the name of the blob, to name the moved blob.

String

destinationContainer (consumer)

The container that moveAfterRead moves the blobs to. Required when moveAfterRead is true.

String

maxMessagesPerPoll (consumer)

Maximum number of blobs to retrieve during one consumer polling cycle. A value of 0 or less means unlimited.

0

int

moveAfterRead (consumer)

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

removePrefixOnMove (consumer)

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

blobSequenceNumber (producer)

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

blockListType (producer)

Which blocks of the block blob getBlobBlockList returns: COMMITTED, UNCOMMITTED or ALL. The CamelAzureStorageBlobBlockListType header replaces this option.

Enum values:

  • committed

  • uncommitted

  • all

COMMITTED

BlockListType

blockSize (producer)

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

changeFeedContext (producer)

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

changeFeedEndTime (producer)

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

changeFeedStartTime (producer)

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

closeStreamAfterWrite (producer)

Whether uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob and uploadPageBlob close the input stream of the message body after the upload.

true

boolean

commitBlockListLater (producer)

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

createAppendBlob (producer)

Whether commitAppendBlob first creates the append blob if it does not exist. The CamelAzureStorageBlobCreateAppendBlob header replaces this option.

true

boolean

createPageBlob (producer)

Whether uploadPageBlob first creates the page blob if it does not exist, as createPageBlob does. The CamelAzureStorageBlobCreatePageBlob header replaces this option.

true

boolean

downloadLinkExpiration (producer)

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

lazyStartProducer (producer)

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

maxConcurrency (producer)

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

maxSingleUploadSize (producer)

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

operation (producer)

The operation that the producer performs. The CamelAzureStorageBlobOperation header replaces this option. If neither is set, the producer performs listBlobContainers.

Enum values:

  • listBlobContainers

  • findBlobsByTags

  • createBlobContainer

  • deleteBlobContainer

  • listBlobs

  • listBlobVersions

  • getBlob

  • deleteBlob

  • downloadBlobToFile

  • downloadLink

  • uploadBlockBlob

  • uploadBlockBlobChunked

  • stageBlockBlobList

  • commitBlobBlockList

  • getBlobBlockList

  • createAppendBlob

  • commitAppendBlob

  • createPageBlob

  • uploadPageBlob

  • resizePageBlob

  • clearPageBlob

  • getPageBlobRanges

  • getChangeFeed

  • copyBlob

  • createBlobSnapshot

  • setBlobTags

  • getBlobTags

  • setBlobLegalHold

  • setBlobImmutabilityPolicy

  • undeleteBlob

  • setBlobTier

listBlobContainers

BlobOperationsDefinition

pageBlobSize (producer)

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

autowiredEnabled (advanced)

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

healthCheckConsumerEnabled (health)

Used for enabling or disabling all consumer based health checks from this component.

true

boolean

healthCheckProducerEnabled (health)

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

accessKey (security)

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

azureClientId (security)

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

azureClientSecret (security)

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

azureTenantId (security)

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

sasToken (security)

The shared access signature (SAS) token that authenticates the client when credentialType is AZURE_SAS. Not used when serviceClient is set.

String

sourceBlobAccessKey (security)

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

accountName (common)

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

containerName (common)

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

blobName (common)

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

blobOffset (common)

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

blobServiceClient (common)

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

blobType (common)

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

  • appendblob

  • pageblob

blockblob

BlobType

closeStreamAfterRead (common)

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

credentials (common)

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

credentialType (common)

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:

  • SHARED_ACCOUNT_KEY

  • SHARED_KEY_CREDENTIAL

  • AZURE_IDENTITY

  • AZURE_SAS

AZURE_IDENTITY

CredentialType

dataCount (common)

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

fileDir (common)

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

leaseBlob (common)

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

leaseDurationInSeconds (common)

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

maxResultsPerPage (common)

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

maxRetryRequests (common)

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

prefix (common)

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

regex (common)

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

serviceClient (common)

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

snapshotId (common)

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

timeout (common)

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

versionId (common)

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

deleteAfterRead (consumer)

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

destinationBlobPrefix (consumer)

The text that moveAfterRead puts before the name of the blob, to name the moved blob.

String

destinationBlobSuffix (consumer)

The text that moveAfterRead appends to the name of the blob, to name the moved blob.

String

destinationContainer (consumer)

The container that moveAfterRead moves the blobs to. Required when moveAfterRead is true.

String

maxMessagesPerPoll (consumer)

Maximum number of blobs to retrieve during one consumer polling cycle. A value of 0 or less means unlimited.

0

int

moveAfterRead (consumer)

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

removePrefixOnMove (consumer)

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

sendEmptyMessageWhenIdle (consumer)

If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.

false

boolean

bridgeErrorHandler (consumer (advanced))

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

exceptionHandler (consumer (advanced))

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

exchangePattern (consumer (advanced))

Sets the exchange pattern when the consumer creates an exchange.

Enum values:

  • InOnly

  • InOut

ExchangePattern

pollStrategy (consumer (advanced))

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

blobSequenceNumber (producer)

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

blockListType (producer)

Which blocks of the block blob getBlobBlockList returns: COMMITTED, UNCOMMITTED or ALL. The CamelAzureStorageBlobBlockListType header replaces this option.

Enum values:

  • committed

  • uncommitted

  • all

COMMITTED

BlockListType

blockSize (producer)

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

changeFeedContext (producer)

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

changeFeedEndTime (producer)

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

changeFeedStartTime (producer)

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

closeStreamAfterWrite (producer)

Whether uploadBlockBlob, uploadBlockBlobChunked, commitAppendBlob and uploadPageBlob close the input stream of the message body after the upload.

true

boolean

commitBlockListLater (producer)

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

createAppendBlob (producer)

Whether commitAppendBlob first creates the append blob if it does not exist. The CamelAzureStorageBlobCreateAppendBlob header replaces this option.

true

boolean

createPageBlob (producer)

Whether uploadPageBlob first creates the page blob if it does not exist, as createPageBlob does. The CamelAzureStorageBlobCreatePageBlob header replaces this option.

true

boolean

downloadLinkExpiration (producer)

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

maxConcurrency (producer)

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

maxSingleUploadSize (producer)

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

operation (producer)

The operation that the producer performs. The CamelAzureStorageBlobOperation header replaces this option. If neither is set, the producer performs listBlobContainers.

Enum values:

  • listBlobContainers

  • findBlobsByTags

  • createBlobContainer

  • deleteBlobContainer

  • listBlobs

  • listBlobVersions

  • getBlob

  • deleteBlob

  • downloadBlobToFile

  • downloadLink

  • uploadBlockBlob

  • uploadBlockBlobChunked

  • stageBlockBlobList

  • commitBlobBlockList

  • getBlobBlockList

  • createAppendBlob

  • commitAppendBlob

  • createPageBlob

  • uploadPageBlob

  • resizePageBlob

  • clearPageBlob

  • getPageBlobRanges

  • getChangeFeed

  • copyBlob

  • createBlobSnapshot

  • setBlobTags

  • getBlobTags

  • setBlobLegalHold

  • setBlobImmutabilityPolicy

  • undeleteBlob

  • setBlobTier

listBlobContainers

BlobOperationsDefinition

pageBlobSize (producer)

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

lazyStartProducer (producer (advanced))

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

backoffErrorThreshold (scheduler)

The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.

int

backoffIdleThreshold (scheduler)

The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.

int

backoffMultiplier (scheduler)

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

delay (scheduler)

Milliseconds before the next poll.

500

long

greedy (scheduler)

If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.

false

boolean

healthCheckMaxPollDuration (scheduler)

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

initialDelay (scheduler)

Milliseconds before the first poll starts.

1000

long

repeatCount (scheduler)

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

runLoggingLevel (scheduler)

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

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • OFF

TRACE

LoggingLevel

scheduledExecutorService (scheduler)

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

scheduler (scheduler)

To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler.

none

Object

schedulerProperties (scheduler)

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

startScheduler (scheduler)

Whether the scheduler should be auto started.

true

boolean

timeUnit (scheduler)

Time unit for initialDelay and delay options.

Enum values:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

MILLISECONDS

TimeUnit

useFixedDelay (scheduler)

Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.

true

boolean

accessKey (security)

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

azureClientId (security)

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

azureClientSecret (security)

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

azureTenantId (security)

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

sasToken (security)

The shared access signature (SAS) token that authenticates the client when credentialType is AZURE_SAS. Not used when serviceClient is set.

String

sourceBlobAccessKey (security)

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

The operation that the producer performs. It replaces the operation option.

Enum values:

  • listBlobContainers

  • findBlobsByTags

  • createBlobContainer

  • deleteBlobContainer

  • listBlobs

  • listBlobVersions

  • getBlob

  • deleteBlob

  • downloadBlobToFile

  • downloadLink

  • uploadBlockBlob

  • uploadBlockBlobChunked

  • stageBlockBlobList

  • commitBlobBlockList

  • getBlobBlockList

  • createAppendBlob

  • commitAppendBlob

  • createPageBlob

  • uploadPageBlob

  • resizePageBlob

  • clearPageBlob

  • getPageBlobRanges

  • getChangeFeed

  • copyBlob

  • createBlobSnapshot

  • setBlobTags

  • getBlobTags

  • setBlobLegalHold

  • setBlobImmutabilityPolicy

  • undeleteBlob

  • setBlobTier

BlobOperationsDefinition

CamelAzureStorageBlobHttpHeaders (producer)

Constant: BLOB_HTTP_HEADERS

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

The ETag of the blob.

String

CamelAzureStorageBlobCreationTime (consumer)

Constant: CREATION_TIME

Creation time of the blob.

OffsetDateTime

CamelAzureStorageBlobLastModified (consumer)

Constant: LAST_MODIFIED

Datetime when the blob was last modified.

OffsetDateTime

CamelMessageTimestamp (consumer)

Constant: MESSAGE_TIMESTAMP

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

Content type specified for the blob.

String

CamelAzureStorageBlobContentMD5 (common)

Constant: CONTENT_MD5

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

Content encoding specified for the blob.

String

CamelAzureStorageBlobContentDisposition (consumer)

Constant: CONTENT_DISPOSITION

Content disposition specified for the blob.

String

CamelAzureStorageBlobContentLanguage (consumer)

Constant: CONTENT_LANGUAGE

Content language specified for the blob.

String

CamelAzureStorageBlobCacheControl (consumer)

Constant: CACHE_CONTROL

Cache control specified for the blob.

String

CamelAzureStorageBlobBlobSize (consumer)

Constant: BLOB_SIZE

The size of the blob in bytes.

long

CamelAzureStorageBlobBlobUploadSize (producer)

Constant: BLOB_UPLOAD_SIZE

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

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

The type of the blob.

Enum values:

  • blockblob

  • appendblob

  • pageblob

BlobType

CamelAzureStorageBlobLeaseBlob (common)

Constant: LEASE_BLOB

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

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

Status of the lease on the blob.

Enum values:

  • locked

  • unlocked

LeaseStatusType

CamelAzureStorageBlobLeaseState (consumer)

Constant: LEASE_STATE

State of the lease on the blob.

Enum values:

  • available

  • leased

  • expired

  • breaking

  • broken

LeaseStateType

CamelAzureStorageBlobLeaseDuration (consumer)

Constant: LEASE_DURATION

Type of lease on the blob.

Enum values:

  • infinite

  • fixed

LeaseDurationType

CamelAzureStorageBlobCopyId (consumer)

Constant: COPY_ID

Identifier of the last copy operation performed on the blob.

String

CamelAzureStorageBlobCopyStatus (consumer)

Constant: COPY_STATUS

Status of the last copy operation performed on the blob.

Enum values:

  • pending

  • success

  • aborted

  • failed

CopyStatusType

CamelAzureStorageBlobCopySource (consumer)

Constant: COPY_SOURCE

Source of the last copy operation performed on the blob.

String

CamelAzureStorageBlobCopyProgress (consumer)

Constant: COPY_PROGRESS

Progress of the last copy operation performed on the blob.

String

CamelAzureStorageBlobCopyCompletionTime (consumer)

Constant: COPY_COMPILATION_TIME

Datetime when the last copy operation on the blob completed.

OffsetDateTime

CamelAzureStorageBlobCopyStatusDescription (consumer)

Constant: COPY_STATUS_DESCRIPTION

Description of the last copy operation on the blob.

String

CamelAzureStorageBlobCopyDestinationSnapshot (consumer)

Constant: COPY_DESTINATION_SNAPSHOT

Snapshot identifier of the last incremental copy snapshot for the blob.

String

CamelAzureStorageBlobIsServerEncrypted (consumer)

Constant: IS_SERVER_ENCRYPTED

Flag indicating if the blob’s content is encrypted on the server.

boolean

CamelAzureStorageBlobIsIncrementalCopy (consumer)

Constant: IS_INCREMENTAL_COPY

Flag indicating if the blob was incrementally copied.

boolean

CamelAzureStorageBlobAccessTier (common)

Constant: ACCESS_TIER

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

Flag indicating if the access tier of the blob was inferred from properties of the blob.

boolean

CamelAzureStorageBlobArchiveStatus (consumer)

Constant: ARCHIVE_STATUS

Archive status of the blob.

ArchiveStatus

CamelAzureStorageBlobEncryptionKeySha256 (consumer)

Constant: ENCRYPTION_KEY_SHA_256

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

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

Datetime when the access tier of the blob last changed.

OffsetDateTime

CamelAzureStorageBlobMetadata (common)

Constant: METADATA

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

The number of committed blocks of the append blob. The consumer, getBlob, downloadBlobToFile and commitAppendBlob set it.

Integer

CamelAzureStorageBlobAppendOffset (consumer)

Constant: APPEND_OFFSET

The offset in the append blob at which commitAppendBlob appended the block.

String

CamelAzureStorageBlobRawHttpHeaders (consumer)

Constant: RAW_HTTP_HEADERS

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

The path of the file that downloadBlobToFile, or the consumer with fileDir, downloaded the blob into.

String

CamelAzureStorageBlobDownloadLink (consumer)

Constant: DOWNLOAD_LINK

The URL of the blob, with a read-only SAS, that downloadLink generates.

String

CamelAzureStorageBlobListBlobOptions (producer)

Constant: LIST_BLOB_OPTIONS

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

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

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

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

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

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

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

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

The name of the container for the producer. It replaces the containerName option.

String

CamelAzureStorageBlobBlobName (common)

Constant: BLOB_NAME

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

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

The directory that downloadBlobToFile downloads the blob into. It replaces the fileDir option.

String

CamelAzureStorageBlobPageBlobRange (producer)

Constant: PAGE_BLOB_RANGE

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

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

Whether stageBlockBlobList only stages the blocks. If false, it commits them right away. It replaces the commitBlockListLater option.

boolean

CamelAzureStorageBlobBlockListType (producer)

Constant: BLOCK_LIST_TYPE

Which blocks of the block blob getBlobBlockList returns: COMMITTED, UNCOMMITTED or ALL. It replaces the blockListType option.

Enum values:

  • committed

  • uncommitted

  • all

BlockListType

CamelAzureStorageBlobCreateAppendBlob (producer)

Constant: CREATE_APPEND_BLOB

Whether commitAppendBlob first creates the append blob if it does not exist. It replaces the createAppendBlob option.

boolean

CamelAzureStorageBlobCreatePageBlob (producer)

Constant: CREATE_PAGE_BLOB

Whether uploadPageBlob first creates the page blob if it does not exist. It replaces the createPageBlob option.

boolean

CamelAzureStorageBlobDeleteSnapshotsOptionType (producer)

Constant: DELETE_SNAPSHOT_OPTION_TYPE

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:

  • include

  • only

DeleteSnapshotsOptionType

CamelAzureStorageBlobListBlobContainersOptions (producer)

Constant: LIST_BLOB_CONTAINERS_OPTIONS

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

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

The path of the local file that uploadBlockBlobChunked uploads, instead of the message body.

String

CamelAzureStorageBlobBlockSize (producer)

Constant: BLOCK_SIZE

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

The maximum number of requests that uploadBlockBlobChunked sends in parallel. It replaces the maxConcurrency option.

Integer

CamelAzureStorageBlobMaxSingleUploadSize (producer)

Constant: MAX_SINGLE_UPLOAD_SIZE

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

How long, in milliseconds, the link that downloadLink generates stays valid. It replaces the downloadLinkExpiration option.

Long

CamelAzureStorageBlobSourceBlobAccountName (producer)

Constant: SOURCE_BLOB_ACCOUNT_NAME

The name of the storage account of the source blob of copyBlob, which requires it.

String

CamelAzureStorageBlobSourceBlobContainerName (producer)

Constant: SOURCE_BLOB_CONTAINER_NAME

The name of the container of the source blob of copyBlob, which requires it.

String

CamelAzureStorageBlobChangeFeedStartTime (producer)

Constant: CHANGE_FEED_START_TIME

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

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

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

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

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

Whether the blob that the consumer, getBlob or downloadBlobToFile read is the current version of the blob.

Boolean

CamelAzureStorageBlobTags (common)

Constant: BLOB_TAGS

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

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

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

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

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

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:

  • Mutable

  • Unlocked

  • Locked

BlobImmutabilityPolicyMode

CamelAzureStorageBlobRehydratePriority (producer)

Constant: REHYDRATE_PRIORITY

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

stream or file

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

any

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.

  • With operation=uploadBlockBlob: text, bytes, stream or file

  • With operation=commitAppendBlob: text, bytes, stream or file

  • With operation=uploadPageBlob: text, bytes, stream or file

  • With operation=stageBlockBlobList: list or pojo

  • With operation=commitBlobBlockList: list or pojo

Producer output

list

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.

  • With operation=getBlob: stream

  • With operation=downloadBlobToFile: file (java.io.File)

  • With operation=getBlobTags: map (java.util.Map<String, String>)

  • With operation=getPageBlobRanges: iterator (com.azure.core.http.rest.PagedIterable<com.azure.storage.blob.models.PageRangeItem>)

  • With operation=getBlobBlockList: pojo (com.azure.storage.blob.models.BlockList)

  • With operation=setBlobImmutabilityPolicy: pojo (com.azure.storage.blob.models.BlobImmutabilityPolicy)

  • With operation=setBlobTier: pojo (com.azure.storage.blob.models.AccessTier)

  • With operation=copyBlob: text (java.lang.String)

  • With operation=createBlobSnapshot: text (java.lang.String)

  • With operation=setBlobLegalHold: value (java.lang.Boolean)

  • With operation=createBlobContainer: value (java.lang.Boolean)

  • With operation=deleteBlobContainer: value (java.lang.Boolean)

  • With operation=deleteBlob: value (java.lang.Boolean)

  • With operation=downloadLink: value (java.lang.Boolean)

  • With operation=uploadBlockBlob: value (java.lang.Boolean)

  • With operation=uploadBlockBlobChunked: value (java.lang.Boolean)

  • With operation=stageBlockBlobList: value (java.lang.Boolean)

  • With operation=commitBlobBlockList: value (java.lang.Boolean)

  • With operation=createAppendBlob: value (java.lang.Boolean)

  • With operation=commitAppendBlob: value (java.lang.Boolean)

  • With operation=createPageBlob: value (java.lang.Boolean)

  • With operation=uploadPageBlob: value (java.lang.Boolean)

  • With operation=resizePageBlob: value (java.lang.Boolean)

  • With operation=clearPageBlob: value (java.lang.Boolean)

  • With operation=setBlobTags: value (java.lang.Boolean)

  • With operation=undeleteBlob: value (java.lang.Boolean)

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_IDENTITY and 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_KEY and providing accountName and accessKey for 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_CREDENTIAL and providing a StorageSharedKeyCredential instance which can be injected into credentials option.

  • Via Azure SAS, when specifying credentialType=AZURE_SAS and providing a SAS Token parameter through the sasToken parameter.

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&amp;credentialType=SHARED_ACCOUNT_KEY&amp;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:

Java-only: programmatic BlobServiceClient setup
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&amp;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

listBlobContainers

List the blob containers of the storage account, as a List<BlobContainerItem>. This is the default operation when operation is not set, so a producer without operation lists the containers and uploads nothing: set operation=uploadBlockBlob to upload the message body.

getChangeFeed

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.

findBlobsByTags

Returns a list of blobs across the storage account whose index tags match the SQL-like filter expression provided via the CamelAzureStorageBlobTagFilter header or the message body. Optionally honours CamelAzureStorageBlobMaxResultsPerPage and CamelAzureStorageBlobTimeout. The result body is a List<TaggedBlobItem>.

Operations on the container level

For these operations, accountName and containerName are required.

Operation Description

createBlobContainer

Create a new container within a storage account. If a container with the same name already exists, the operation fails.

deleteBlobContainer

Delete the specified container in the storage account. If the container doesn’t exist, the operation fails.

listBlobs

Returns a list of blobs in this container, with folder structures flattened.

listBlobVersions

Returns a list of blobs and their versions in this container. Each BlobItem in the result carries its own versionId and isCurrentVersion flag, allowing the full version history of every blob to be inspected. Requires versioning to be enabled on the storage account. Honours the same prefix, regex and maxResultsPerPage filters as listBlobs.

Operations on the blob level

For these operations, accountName, containerName and blobName are required.

Operation Blob Type Description

getBlob

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 OutputStream; any other body is replaced by an InputStream of the content.

deleteBlob

Common

Delete a blob.

downloadBlobToFile

Common

Download the blob into a file of the fileDir directory, named after the blob. A file that already exists is replaced.

downloadLink

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.

uploadBlockBlob

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

uploadBlockBlobChunked

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 blockSize (default: 4MB) and maxConcurrency (default: 8) for performance tuning. Recommended for files larger than 256MB.

stageBlockBlobList

BlockBlob

Uploads the specified block to the block blob’s "staging area" to be later committed by a call to commitBlobBlockList. However, in case header CamelAzureStorageBlobCommitBlobBlockListLater or config commitBlockListLater is set to false, this will commit the blocks immediately after staging the blocks.

commitBlobBlockList

BlockBlob

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 stageBlockBlobList operation. You can call commitBlobBlockList to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. Any blocks not specified in the block list and permanently deleted.

getBlobBlockList

BlockBlob

Returns the list of blocks that have been uploaded as part of a block blob using the specified blocklist filter.

createAppendBlob

AppendBlob

Creates a 0-length append blob. Call commitAppendBlo`b operation to append data to an append blob.

commitAppendBlob

AppendBlob

Commits a new block of data to the end of the existing append blob. In case of header CamelAzureStorageBlobCreateAppendBlob or config createAppendBlob is set to true, it will attempt to create the appendBlob through internal call to createAppendBlob operation first before committing.

createPageBlob

PageBlob

Creates a page blob of the specified length. Call uploadPageBlob operation to upload data to a page blob.

uploadPageBlob

PageBlob

Write one or more pages to the page blob. The size must be a multiple of 512. In case of header CamelAzureStorageBlobCreatePageBlob or config createPageBlob is set to true, it will attempt to create the page blob through internal call to createPageBlob operation first before uploading.

resizePageBlob

PageBlob

Resizes the page blob to the specified size, which must be a multiple of 512.

clearPageBlob

PageBlob

Free the specified pages from the page blob. The size of the range must be a multiple of 512.

getPageBlobRanges

PageBlob

Returns the list of valid page ranges for a page blob or snapshot of a page blob.

copyBlob

Common

Copy a blob from one container to another one, even from different accounts.

createBlobSnapshot

Common

Creates a read-only snapshot of a blob. The snapshot ID is returned in the CamelAzureStorageBlobSnapshotId header.

setBlobTags

Common

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 CamelAzureStorageBlobTags header or as the message body (Map<String, String>).

getBlobTags

Common

Retrieves user-defined index tags from a blob. The tags are returned as the message body (Map<String, String>) and also set in the CamelAzureStorageBlobTags header.

setBlobLegalHold

Common

Sets a legal hold on a blob. The legal hold flag (Boolean) is provided via the CamelAzureStorageBlobLegalHold header or the message body. While a legal hold is set, the blob cannot be modified or deleted until the hold is explicitly cleared by calling the operation again with false.

setBlobImmutabilityPolicy

Common

Sets a time-based immutability policy on a blob. The policy expiry time (OffsetDateTime) is read from the CamelAzureStorageBlobImmutabilityPolicyExpiryTime header and the policy mode (BlobImmutabilityPolicyMode, defaults to UNLOCKED) from CamelAzureStorageBlobImmutabilityPolicyMode. A pre-built BlobImmutabilityPolicy may also be supplied via the message body or CamelAzureStorageBlobImmutabilityPolicy header.

undeleteBlob

Common

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.

setBlobTier

Common

Sets the access tier of an existing blob. The target tier (AccessTier such as HOT, COOL, COLD, or ARCHIVE) is read from the CamelAzureStorageBlobAccessTier header or the message body. When rehydrating a blob from ARCHIVE, the optional CamelAzureStorageBlobRehydratePriority header (RehydratePriority, STANDARD or HIGH) controls the rehydration priority.

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.