8.6. Spring Boot Auto-Configuration


当在 Spring Boot 中使用 azure-storage-blob 时,请确保使用以下 Maven 依赖项支持自动配置:

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-azure-storage-blob-starter</artifactId>
  <version>{CamelSBProjectVersion}</version>
  <!-- Use your Camel Spring Boot version -->
</dependency>
Copy to Clipboard Toggle word wrap

组件支持 32 个选项,它们如下所列。

Expand
Name描述默认类型

camel.component.azure-storage-blob.access-key

用于通过 azure blob 服务进行身份验证的相关 azure 帐户名称的访问密钥。

 

字符串

camel.component.azure-storage-blob.autowired-enabled

是否启用了 autowiring。这用于自动自动选项( 选项必须标记为自动线),方法是在 registry 中查找是否有匹配的类型实例,然后再在组件上配置。这可用于自动配置 JDBC 数据源、JMS 连接工厂、AWS 客户端等。

true

布尔值

camel.component.azure-storage-blob.blob-name

blob 名称,要使用容器中的特定 blob。但是在制作者中,只有 blob 级别上的操作才需要它。

 

字符串

camel.component.azure-storage-blob.blob-offset

为上传或下载操作设置 blob 偏移,默认为 0。

0

Long

camel.component.azure-storage-blob.blob-sequence-number

用户控制的值可用来跟踪请求。序列号的值必须在 0 到 263 - 1 之间。默认值为 0。

0

Long

camel.component.azure-storage-blob.blob-type

blob 类型,用来为每个 blob 类型启动适当的设置。

 

BlobType

camel.component.azure-storage-blob.block-list-type

指定要返回的块类型。

 

BlockListType

camel.component.azure-storage-blob.bridge-error-handler

允许将消费者桥接到 Camel 路由 Error Handler,这意味着使用者试图获取传入消息或类似信息时出现任何异常,现在将作为一个消息进行处理,并由路由 Error Handler 处理。默认情况下,使用者将使用 org.apache.camel.spi.Exception 处理程序处理异常,该处理程序将记录在 WARN 或 ERROR 级别,并忽略。

false

布尔值

camel.component.azure-storage-blob.change-feed-context

使用 getChangeFeed producer 操作时,这提供了在服务调用期间通过 Http 管道传递的其他上下文。选项是一个 com.azure.core.util.Context 类型。

 

Context

camel.component.azure-storage-blob.change-feed-end-time

使用 getChangeFeed producer 操作时,此结果会过滤结果,以返回大约在结束时间前发生的事件。注意:也可以返回属于下一个小时的几个事件。可以缺少几个属于此小时的事件;若要确保返回小时中的所有事件,需每小时向上取整时间。选项是一个 java.time.OffsetDateTime 类型。

 

OffsetDateTime

camel.component.azure-storage-blob.change-feed-start-time

使用 getChangeFeed producer 操作时,此结果会过滤结果,以在启动时间大约返回相关的事件。注意:也可以返回属于上一小时的几个事件。可以缺少几个属于此小时的事件;若要确保返回小时中的所有事件,可按小时来回转开始时间。选项是一个 java.time.OffsetDateTime 类型。

 

OffsetDateTime

camel.component.azure-storage-blob.close-stream-after-read

读取或保持打开后的流是 true。

true

布尔值

camel.component.azure-storage-blob.close-stream-after-write

在写入或保留流后关闭流,默认为 true。

true

布尔值

camel.component.azure-storage-blob.commit-block-list-later

当 设置为 true 时,暂存块不会直接提交。

true

布尔值

camel.component.azure-storage-blob.configuration

组件配置。选项是一个 org.apache.camel.component.azure.storage.blob.BlobConfiguration 类型。

 

BlobConfiguration

camel.component.azure-storage-blob.create-append-blob

当 设置为 true 时,在提交附加块时将创建附加块。

true

布尔值

camel.component.azure-storage-blob.create-page-blob

当设置为 true 时,将在上传页面 blob 时创建 page blob。

true

布尔值

camel.component.azure-storage-blob.credentials

StorageSharedKeyCredential 可以注入来创建 azure 客户端,这包含重要的身份验证信息。选项是一个 com.azure.storage.common.StorageSharedKeyCredential 类型。

 

StorageSharedKeyCredential

camel.component.azure-storage-blob.data-count

范围中包含的字节数。如果指定,则必须大于或等于 0。

 

Long

camel.component.azure-storage-blob.download-link-expiration

覆盖 URL 下载链接的默认过期(millis)。

 

Long

camel.component.azure-storage-blob.enabled

是否启用 azure-storage-blob 组件的自动配置。这会被默认启用。

 

布尔值

camel.component.azure-storage-blob.file-dir

下载的 Blob 将保存到的 directory 中,这可用于生产者和使用者。

 

字符串

camel.component.azure-storage-blob.lazy-start-producer

制作者是否应启动 lazy (在第一条消息中)。通过开始 lazy,您可以使用此方法来允许 CamelContext 和路由在制作者无法启动时启动失败,并导致路由无法启动。通过将此启动推迟为 lazy,则启动失败可以通过 Camel 的路由错误处理程序在路由消息期间处理。请注意,当处理第一条消息时,创建和启动制作者可能需要花费一些时间,延长处理总处理时间。

false

布尔值

camel.component.azure-storage-blob.max-results-per-page

指定要返回的最大 Blob 数,包括所有 BlobPrefix 元素。如果请求没有指定 maxResultsPerPage,或者指定值大于 5,000,服务器会返回最多 5,000 个项。

 

整数

camel.component.azure-storage-blob.max-retry-requests

指定从响应正文读取数据时所需的额外 HTTP Get 请求的最大数量。

0

整数

camel.component.azure-storage-blob.operation

此组件的 blob 操作可用于制作者上的这一组件。

 

BlobOperationsDefinition

camel.component.azure-storage-blob.page-blob-size

指定页面 blob 的最大大小,最多指定 8 TB。page blob 大小必须与 512 字节边界一致。

512

Long

camel.component.azure-storage-blob.prefix

过滤结果,以仅返回名称以指定前缀开头的 Blob。可以是 null,以返回所有 Blob。

 

字符串

camel.component.azure-storage-blob.regex

过滤结果,以仅返回名称与指定正则表达式匹配的 Blob。如果同时设置了前缀和正则表达式,则可为 null 返回所有前缀,则忽略 regex。

 

字符串

camel.component.azure-storage-blob.service-client

存储帐户的客户端。此客户端不保存关于特定存储帐户的任何状态,而是最好将适当的请求发送到该服务上的资源。它还可用来为 blob 和容器构建 URL。此客户端包含服务帐户的操作。容器上的操作可以通过 BlobServiceClient#getBlobContainerClient (String)在 BlobClient 上通过 BlobContainerClient#getBlobClient (String)提供。选项为 com.azure.storage.blob.BlobServiceClient 类型。

 

BlobServiceClient

camel.component.azure-storage-blob.source-blob-access-key

Source Blob Access Key: for copyblob 操作(sadly),我们需要为源 blob 有一个 accessKey 作为标头来复制 accessKey,因此可以将其设置为密钥。

 

字符串

camel.component.azure-storage-blob.timeout

引发 RuntimeException 的可选超时值。选项是一个 java.time.Duration 类型。

 

Duration

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat