aws-snsPage added by Tracy SnellSNS ComponentThe SNS component allows messages to be sent to or consumed from an Amazon Simple Notification Topic. The implementation of the Amazon API is provided by the AWS SDK. URI Formatsns://topicName/yourTopicName?optionsThe "topicName/" path is a flag that the value following the slash is a topic name that should be created or one that already exists. Alternatively, you can access existing topics by their Amazon Resource Name (ARN) as follows:sns://arn:aws:sns:us-east-1:123456789012:yourTopicName?optionsYou can append query options to the URI in the following format, ?options=value&option2=value&...Endpoint PropertiesCommon Properties
Consumer Only Properties
Producer Only Properties
Consumer Use CasesSubscribing to a topic
Topic PermissionsIf the topic is referenced by its name then the caller is assumed to be the owner of the topic. The create topic API call is used to create the topic by name or return the topic if it already exists. If the topic is referenced by its Amazon Resource Name (ARN) then it is assumed that the caller has access to subscribe to the topic. Queue PermissionsThe only supported subscriber endpoint at the moment is an Amazon Simple Queue Service (SQS). If the queue is referenced by its name, then the caller is assumed to be the owner of the queue. The create queue API call is used to create the queue by name or return the queue if it already exists. When the queue is created, its default policy is overridden to allow the SNS ARN to send messages to the queue. Note that the documentation for SQS states that the policy may take up to 60 seconds to propagate although in practice it appears to be taking over 90 seconds. The result is that the SQS endpoint will not begin receiving messages until the policy is propagated. The unit tests that alter the policy of a queue sleep for 2 minutes to ensure that the policy has been applied. This will be revisited when the SQS service changes. If the queue is references by its ARN then it is assumed that the queue exists and has sufficient permissions on it to receive messages from the topic. UnsubscribingThe consumer will automatically unsubscribe from the topic once it is stopped. Topic/Queue deletionThe consumer will optionally delete the topic or queue when it is stopped. See the above for info on controlling this and other behavior with endpoint properties. See DeleteQueueOnStopTest.java and DeleteTopicOnStopTest.java for examples. Message Mapping between SNS and CamelThe component will unwrap the message payload from its JSON format and put the message field into the camel message payload and add all of the other fields as headers prefixed with "SNS:". The available properties on the message are as follow:
These properties can be used to filter messages in the route. See FilterBySubjectTest.java for an example of filtering messages by subject. Producer Use Cases
AWS Unit TestsThe unit tests that invoke the AWS services require valid credentials in order to work. These credentials are set in a file in the test directory (src/test/resources/awscreds.properties). Either modify this file to contain the correct accessKey and secretKey or pass these values in via the command line or export as system properties. awscreds.propertiesaccessKey=$ Unknown macro: {env.accessKey}
secretKey=$ Unknown macro: {env.secretKey}
Sample command line:mvn clean install -DaccessKey=YOUR-ACCESS-KEY -DsecreteKey=YOUR-SECRET-KEY
Change Notification Preferences
View Online
|
Add Comment
|
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
- [CONF] Apache Camel > aws-sns confluence
