Camel Spring Boot

AWS Simple Notification System (SNS)

Publish messages to a topic of Amazon Simple Notification Service (SNS).

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-aws2-sns-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 32 options, which are listed below.

Name Description Default Type

camel.component.aws2-sns.access-key

The access key ID of the AWS credentials, used together with the secretKey option. The endpoint requires it, unless amazonSNSClient is set or useDefaultCredentialsProvider, useProfileCredentialsProvider or useSessionCredentials is true.

String

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

To use a custom software.amazon.awssdk.services.sns.SnsClient, which is autowired when the registry has a single one. When this option is set, the credentials, region, proxy, endpoint override and trustAllCertificates options are not used. The endpoint does not close a client that is set or autowired. The option is a software.amazon.awssdk.services.sns.SnsClient type.

SnsClient

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

Whether the endpoint creates the topic when it starts, if no topic with this name exists in the region. A name that ends with .fifo creates a FIFO topic. If false and the topic does not exist, the publish fails.

false

Boolean

camel.component.aws2-sns.autowired-enabled

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

camel.component.aws2-sns.batch-enabled

Whether the producer publishes a batch of messages instead of one. The body must then be a List of the PublishBatchRequestEntry of the AWS SDK, at most 10, and the producer replaces it with the PublishBatchResponse. The subject, messageStructure and message group and deduplication options and the headers are not used for a batch.

false

Boolean

camel.component.aws2-sns.configuration

The configuration that the endpoints of this component start from. Each endpoint gets a copy of it, and the options of the endpoint replace its values. The option is a org.apache.camel.component.aws2.sns.Sns2Configuration type.

Sns2Configuration

camel.component.aws2-sns.enabled

Whether to enable auto configuration of the aws2-sns component. This is enabled by default.

Boolean

camel.component.aws2-sns.health-check-consumer-enabled

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

true

Boolean

camel.component.aws2-sns.health-check-producer-enabled

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

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

The ID, alias or ARN of the AWS KMS key that encrypts the topic, for example alias/aws/sns for the AWS managed key of Amazon SNS. It is used only when the endpoint creates the topic and serverSideEncryptionEnabled is true, and it is required then.

String

camel.component.aws2-sns.lazy-start-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

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

How the producer sets the message deduplication ID for a FIFO topic: useExchangeId uses the ID of the exchange, and useContentBasedDeduplication sets none, so that Amazon SNS deduplicates by the content of the message, which the topic must enable. A FIFO topic that the endpoint creates with useContentBasedDeduplication has content-based deduplication enabled.

useExchangeId

String

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

How the producer sets the message group ID for a FIFO topic: useConstant puts all messages in one group, useExchangeId uses the ID of the exchange, and usePropertyValue the exchange property CamelAwsSnsMessageGroupId. Amazon SNS requires a message group ID for a FIFO topic, so set this option for one. It is not used for a standard topic.

String

camel.component.aws2-sns.message-structure

Set to json to send a different message for each protocol: the body is then a JSON object with a default key and a key per protocol, such as email or sqs. The CamelAwsSnsMessageStructure header replaces this option. It is not used when batchEnabled is true.

String

camel.component.aws2-sns.override-endpoint

Whether to send the requests to the URI of the uriEndpointOverride option instead of the endpoint of the region. It has no effect when uriEndpointOverride is not set.

false

Boolean

camel.component.aws2-sns.policy

The access policy of the topic, a JSON document that the endpoint sets on the topic when it starts, also on a topic that exists already. It is loaded from the classpath by default; use the prefix file: or http: to load it from another location.

String

camel.component.aws2-sns.profile-credentials-name

The name of the profile in the AWS shared credentials and config files, used when useProfileCredentialsProvider is true. If not set, the AWS SDK uses its default profile, which the AWS_PROFILE environment variable can change.

String

camel.component.aws2-sns.proxy-host

The host name of the proxy that the HTTP client of Amazon SNS connects through. The proxy is used only when the proxyPort option is set too.

String

camel.component.aws2-sns.proxy-port

The port of the proxy that the HTTP client of Amazon SNS connects through. The proxy is used only when the proxyHost option is set too.

Integer

camel.component.aws2-sns.proxy-protocol

The protocol that the HTTP client of Amazon SNS uses to connect to the proxy. It is used only when the proxyHost and proxyPort options are set.

https

Protocol

camel.component.aws2-sns.queue-arn

The ARN of the Amazon SQS queue that the endpoint subscribes to the topic when it starts, if subscribeSNStoSQS is true. The access policy of the queue must allow the topic to send messages to it.

String

camel.component.aws2-sns.region

The AWS region of Amazon SNS, as a region ID such as eu-west-1, which is the value of Region.EU_WEST_1.id(). If not set, the default region provider chain of the AWS SDK is used. When the topic is given as an ARN, its region replaces the region of the component, and this option on the endpoint replaces both.

String

camel.component.aws2-sns.secret-key

The secret access key of the AWS credentials, used together with the accessKey option. The endpoint requires it, unless amazonSNSClient is set or useDefaultCredentialsProvider, useProfileCredentialsProvider or useSessionCredentials is true.

String

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

Whether the topic that the endpoint creates, see autoCreateTopic, is encrypted with the AWS KMS key of the kmsMasterKeyId option. It does not change a topic that exists already.

false

Boolean

camel.component.aws2-sns.session-token

The session token of temporary AWS credentials, for example of an assumed IAM role. It is used only when useSessionCredentials is true, together with the accessKey and secretKey options. When it is not set, the accessKey and secretKey options are used without a session token.

String

camel.component.aws2-sns.subject

The subject of the message, which Amazon SNS uses as the Subject line of the email for email subscriptions. The CamelAwsSnsSubject header replaces this option. The producer cuts a subject longer than 100 characters, and does not use it when batchEnabled is true.

String

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

Whether the endpoint subscribes the Amazon SQS queue of the queueArn option to the topic when it starts. The queueArn option is required then.

false

Boolean

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

Whether the HTTP client of Amazon SNS trusts every TLS certificate without checking it. It applies to any endpoint, not only to an overridden one, so use it only for testing, for example against a local emulator.

false

Boolean

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

The URI of the endpoint to use instead of the endpoint of the region, for example http://localhost:4566 for a local emulator. It is used only when overrideEndpoint is true.

String

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

Whether to load the credentials with the default credentials provider chain of the AWS SDK, which looks in system properties, environment variables, the shared credentials and config files, and the container or instance role. It takes precedence over the other credentials options.

false

Boolean

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

Whether to load the credentials from a profile of the AWS shared credentials and config files, the one of the profileCredentialsName option. It is not used when useDefaultCredentialsProvider is true, and it takes precedence over the session and static credentials.

false

Boolean

camel.component.aws2-sns.use-session-credentials

Whether to use temporary credentials made of the accessKey, secretKey and sessionToken options, for example those of an assumed IAM role. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true.

false

Boolean