10.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> </dependency>
组件支持 32 个选项,如下所列。
Name | 描述 | 默认值 | 类型 |
---|---|---|---|
camel.component.azure-storage-blob.access-key | 用于连接 azure 帐户名称的访问密钥,用于使用 azure blob 服务进行身份验证。 | 字符串 | |
camel.component.azure-storage-blob.autowired-enabled | 是否启用自动关闭。这用于自动关闭选项(选项必须标记为 autowired),方法是在 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 处理。默认情况下,使用者将使用 org.apache.camel.spi.ExceptionHandler 来处理例外情况,该处理程序将被记录在 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 时将创建页面 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 保存到的文件的目录,这可用于生成者和消费者。 | 字符串 | |
camel.component.azure-storage-blob.lazy-start-producer | 生成者是否应懒惰启动 (在第一个消息中)。通过懒惰启动,您可以使用此选项来允许 CamelContext 和路由在生成者启动期间启动,并导致路由启动失败。通过懒惰启动,启动失败可以在路由信息时通过 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 获取请求的最大数量。 | 0 | 整数 |
camel.component.azure-storage-blob.operation | 可在制作者上与这个组件一起使用的 blob 操作。 | BlobOperationsDefinition | |
camel.component.azure-storage-blob.page-blob-size | 指定页面 blob 的最大大小,最多 8 TB。页面 blob 大小必须与 512 字节边界一致。 | 512 | Long |
camel.component.azure-storage-blob.prefix | 过滤结果,以仅返回名称以指定前缀开头的 Blob。可以是 null,以返回所有 Blob。 | 字符串 | |
camel.component.azure-storage-blob.regex | 过滤结果,以仅返回名称与指定正则表达式匹配的 Blob。如果同时设置了 prefix 和 regex,则正则表达式 可能是 null,则忽略 priority 和 prefix。 | 字符串 | |
camel.component.azure-storage-blob.service-client | 客户端到存储帐户。此客户端不包含有关特定存储帐户的状态,而是便捷地将适当的请求发送到该服务上的资源。它还可用于将 URL 构造到 blob 和容器。此客户端包含服务帐户的操作。容器的操作可在 BlobContainerClient via BlobServiceClient114getBlobContainerClient (String)上提供,并且 blob 上的操作可以通过 BlobContainerClient114getBlobClient (String)在 BlobClient 上提供。选项是一个 com.azure.storage.blob.BlobServiceClient 类型。 | BlobServiceClient | |
camel.component.azure-storage-blob.source-blob-access-key | source Blob Access Key: 对于复制blob 操作,我们需要为源 Blob 有一个 accessKey,我们需要复制 accessKey 作为标头,因此我们可以设置为密钥。 | 字符串 | |
camel.component.azure-storage-blob.timeout | 可选的超时值,超过 RuntimeException 会被引发。选项是一个 java.time.Duration 类型。 | Duration |