6.10. Spring Boot Auto-Configuration


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

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

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

Expand
Name描述默认类型

camel.component.aws2-sns.access-key

Amazon AWS 访问密钥。

 

字符串

camel.component.aws2-sns.amazon-s-n-s-client

将 AmazonSNS 用作客户端。选项是一个 software.amazon.awssdk.services.sns.SnsClient 类型。

 

SnsClient

camel.component.aws2-sns.auto-create-topic

设置主题的自动填充。

false

布尔值

camel.component.aws2-sns.autowired-enabled

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

true

布尔值

camel.component.aws2-sns.configuration

组件配置。选项是一个 org.apache.camel.component.aws2.sns.Sns2Configuration 类型。

 

Sns2Configuration

camel.component.aws2-sns.enabled

是否启用 aws2-sns 组件的自动配置。这会被默认启用。

 

布尔值

camel.component.aws2-sns.kms-master-key-id

Amazon SNS 或自定义 CMK 的 AWS 管理的客户 master 密钥(CMK)的 ID。

 

字符串

camel.component.aws2-sns.lazy-start-producer

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

false

布尔值

camel.component.aws2-sns.message-deduplication-id-strategy

只适用于 FIFO 主题。在消息上设置 messageDeduplicationId 的策略。可以是以下选项之一: useExchangeId,使用ContentBasedDeduplication。对于 useContentBasedDeduplication 选项,消息中不会设置 messageDeduplicationId。

useExchangeId

字符串

camel.component.aws2-sns.message-group-id-strategy

只适用于 FIFO 主题。用于在消息上设置 messageGroupId 的策略。可以是以下选项之一: useConstant, useExchangeId, usePropertyValue。对于 usePropertyValue 选项,将使用属性 CamelAwsMessageGroupId 的值。

 

字符串

camel.component.aws2-sns.message-structure

要使用的消息结构,如 json。

 

字符串

camel.component.aws2-sns.override-endpoint

设置用于隐藏端点的需求。这个选项需要与 uriEndpointOverride 选项结合使用。

false

布尔值

camel.component.aws2-sns.policy

本主题的策略。默认情况下,由 classpath 加载,但您可以使用 classpath:、file: 或 http: 前缀来从不同的系统加载资源。

 

字符串

camel.component.aws2-sns.proxy-host

在实例化 SNS 客户端时,要定义代理主机。

 

字符串

camel.component.aws2-sns.proxy-port

在实例化 SNS 客户端时,要定义代理端口。

 

整数

camel.component.aws2-sns.proxy-protocol

在实例化 SNS 客户端时定义代理协议。

 

协议

camel.component.aws2-sns.queue-url

要订阅的 queueUrl。

 

字符串

camel.component.aws2-sns.region

SNS 客户端需要工作的区域。使用此参数时,该配置期望区域(例如 ap-east-1)的小写名称需要使用名称 Region.EU_WEST_1.id ()。

 

字符串

camel.component.aws2-sns.secret-key

Amazon AWS 机密密钥。

 

字符串

camel.component.aws2-sns.server-side-encryption-enabled

定义是否启用了 Server Side Encryption 或 not on the topic。

false

布尔值

camel.component.aws2-sns.subject

如果消息标题为"CamelAwsSnsSubject",则使用该主题。

 

字符串

camel.component.aws2-sns.subscribe-s-n-sto-s-q-s

定义 SNS Topic 和 SQS 之间是否必须执行的订阅。

false

布尔值

camel.component.aws2-sns.trust-all-certificates

如果要信任覆盖端点的所有证书。

false

布尔值

camel.component.aws2-sns.uri-endpoint-override

设置覆盖 uri 端点。这个选项必须与 overrideEndpoint 选项结合使用。

 

字符串

camel.component.aws2-sns.use-default-credentials-provider

设置 SNS 客户端是否应该需要在 AWS infra 实例中加载凭证,或者预期传递静态凭证。

false

布尔值

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat