org.mule.modules

mule-module-sns

config

Namespacehttp://www.mulesoft.org/schema/mule/sns
Schema Locationhttp://www.mulesoft.org/schema/mule/sns/current/mule-sns.xsd  (View Schema)
Schema Version1.0
Minimum Mule Version3.2

Module Overview

Amazon Simple Notification Service (Amazon SNS) is a web service that makes it easy to set up, operate, and send notifications from the cloud. It provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications. It is designed to make web-scale computing easier for developers.

Summary

Configuration
<sns:config>
Configure an instance of this module
Message Processors
<sns:add-permission>
Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions.
<sns:confirm-subscription>
The ConfirmSubscription action verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action.
<sns:create-topic>
The CreateTopic action creates a topic to which notifications can be published.
<sns:delete-topic>
The DeleteTopic action deletes a topic and all its subscriptions.
<sns:get-subscription-attributes>
The GetSubscriptionAttribtues action returns all of the properties of a subscription.
<sns:get-topic-attributes>
The GetTopicAttributes action returns all of the properties of a topic.
<sns:list-subscriptions>
The ListSubscriptions action returns a list of the requester's subscriptions.
<sns:list-subscriptions-by-topic>
The ListSubscriptionsByTopic action returns a list of the subscriptions to a specific topic.
<sns:list-topics>
The ListTopics action returns a list of the requester's topics.
<sns:publish>
The Publish action sends a message to all of a topic's subscribed endpoints.
<sns:remove-permission>
The RemovePermission action removes a statement from a topic's access control policy.
<sns:set-subscription-attributes>
The SetSubscriptionAttributes action allows a subscription owner to set an attribute of the topic to a new value.
<sns:set-topic-attributes>
The SetTopicAttributes action allows a topic owner to set an attribute of the topic to a new value.
<sns:subscribe>
The Subscribe action prepares to subscribe an endpoint by sending the endpoint a confirmation message.
<sns:unsubscribe>
The Unsubscribe action deletes a subscription.

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:sns="http://www.mulesoft.org/schema/mule/sns"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/sns
               http://www.mulesoft.org/schema/mule/sns/current/mule-sns.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

Connection Pool

This connector offers automatic connection management via the use of a connection pool. The pool will act a storage mechanism for all the connections that are in-use by the user of this connector.

Prior to execution of a processor, the connector will attempt to lookup an already established connection and if one doesn't exists it will create one. That lookup mechanism is done in the connection pool via the use of connection variables declared as keys.

The user of the connector can configure the pool by adding a connection-pooling-profile to the connector configuration like this:

    <sns:connection-pooling-profile maxActive="10" maxIdle="10"
                             exhaustedAction="WHEN_EXHAUSTED_GROW" maxWait="120" minEvictionMillis="60000" evictionCheckIntervalMillis="30000"/>

The following is a list of connection attributes, each connection attribute can be configured at the config element level or they can also be added to each processor. If they are used at the processor level they get the benefit of full expression resolution.

Connection Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
accessKey The access key provided by Amazon String */* UTF-8
secretKey The secrete key provided by Amazon String */* UTF-8

Reconnection Strategies

Reconnection Strategies specify how a connector behaves when its connection fails. You can control how Mule attempts to reconnect by specifying a number of criteria:

With a reconnection strategy, you can better control the behavior of a failed connection, by configuring it, for example, to re-attempt the connection only once every 15 minutes, and to give up after 30 attempts. You can also send an automatic notification to your IT administrator whenever this reconnection strategy goes into effect. You can even define a strategy that attempts to reconnect only during business hours. Such a setting can prove useful if your server is frequently shut down for nightly maintenance.

Configuration

A reconnection strategy that allows the user to configure how many times a reconnection should be attempted and how long to wait between attempts.

    <sns:config>
         <reconnect count="5" frequency="1000"/>
    </sns:config>
Reconnect Attributes
NameDefault ValueDescription
frequency 2000 Optional. How often (in ms) to reconnect
count 2 Optional. How many reconnection attempts to make

For more information about reconnection strategies in Mule, or even how to write your own custom reconnection strategy please check this section.

Message Processors

<sns:add-permission>

Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
addPermissionRequest #[payload] Optional. Request object AddPermissionRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8

<sns:confirm-subscription>

The ConfirmSubscription action verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action. If the token is valid, the action creates a new subscription and returns its Amazon Resource Name (ARN). This call requires an AWS signature only when the AuthenticateOnUnsubscribe flag is set to "true".

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
confirmSubscriptionRequest #[payload] Optional. Request object ConfirmSubscriptionRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Returns
Return Type Description
ConfirmSubscriptionResult operation results

<sns:create-topic>

The CreateTopic action creates a topic to which notifications can be published. Users can create at most 100 topics

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
createTopicRequest #[payload] Optional. Request object CreateTopicRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Returns
Return Type Description
CreateTopicResult operation results

<sns:delete-topic>

The DeleteTopic action deletes a topic and all its subscriptions. Deleting a topic might prevent some messages previously sent to the topic from being delivered to subscribers. This action is idempotent, so deleting a topic that does not exist does not result in an error.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
deleteTopicRequest #[payload] Optional. Request object DeleteTopicRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8

<sns:get-subscription-attributes>

The GetSubscriptionAttribtues action returns all of the properties of a subscription.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
getSubscriptionAttributesRequest #[payload] Optional. Request object GetSubscriptionAttributesRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Returns
Return Type Description
GetSubscriptionAttributesResult operation results

<sns:get-topic-attributes>

The GetTopicAttributes action returns all of the properties of a topic. Topic properties returned might differ based on the authorization of the user.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
getTopicAttributesRequest #[payload] Optional. Request object GetTopicAttributesRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Returns
Return Type Description
GetTopicAttributesResult operation results

<sns:list-subscriptions>

The ListSubscriptions action returns a list of the requester's subscriptions. Each call returns a limited list of subscriptions, up to 100. If there are more subscriptions, a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptions call to get further results.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<sns:list-subscriptions-request> #[payload] Optional. Request object ListSubscriptionsRequest
Returns
Return Type Description
ListSubscriptionsResult operation results

<sns:list-subscriptions-by-topic>

The ListSubscriptionsByTopic action returns a list of the subscriptions to a specific topic. Each call returns a limited list of subscriptions, up to 100. If there are more subscriptions, a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic call to get further results.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<sns:list-subscriptions-by-topic-request> #[payload] Optional. Request object ListSubscriptionsByTopicRequest
Returns
Return Type Description
ListSubscriptionsByTopicResult operation results

<sns:list-topics>

The ListTopics action returns a list of the requester's topics. Each call returns a limited list of topics, up to 100. If there are more topics, a NextToken is also returned. Use the NextToken parameter in a new ListTopics call to get further results.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<sns:list-topics-request> #[payload] Optional. Request object ListTopicsRequest
Returns
Return Type Description
ListTopicsResult operation results

<sns:publish>

The Publish action sends a message to all of a topic's subscribed endpoints. When a messageId is returned, the message has been saved and Amazon SNS will attempt to deliver it to the topic's subscribers shortly. The format of the outgoing message to each subscribed endpoint depends on the notification protocol selected.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
publishRequest #[payload] Optional. Request object PublishRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Returns
Return Type Description
PublishResult operation results

<sns:remove-permission>

The RemovePermission action removes a statement from a topic's access control policy.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
removePermissionRequest #[payload] Optional. Request object RemovePermissionRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8

<sns:set-subscription-attributes>

The SetSubscriptionAttributes action allows a subscription owner to set an attribute of the topic to a new value.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
setSubscriptionAttributesRequest #[payload] Optional. Request object SetSubscriptionAttributesRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8

<sns:set-topic-attributes>

The SetTopicAttributes action allows a topic owner to set an attribute of the topic to a new value.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
setTopicAttributesRequest #[payload] Optional. Request object SetTopicAttributesRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8

<sns:subscribe>

The Subscribe action prepares to subscribe an endpoint by sending the endpoint a confirmation message. To actually create a subscription, the endpoint owner must call the ConfirmSubscription action with the token from the confirmation message. Confirmation tokens are valid for three days.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
subscribeRequest #[payload] Optional. Request object SubscribeRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8
Returns
Return Type Description
SubscribeResult operation results

<sns:unsubscribe>

The Unsubscribe action deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the its topic's owner can unsubscribe, and an AWS signature is required. If the Unsubscribe call does not require authentication and the requester is not the subscription owner, a final cancellation message is delivered to the endpoint, so that the endpoint owner can easily resubscribe to the topic if the Unsubscribe request was unintended.

API reference

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
unsubscribeRequest #[payload] Optional. Request object UnsubscribeRequest */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
accessKey Optional. The access key provided by Amazon String */* UTF-8
secretKey Optional. The secrete key provided by Amazon String */* UTF-8

Message Sources

Transformers