Subscribe to SNS
To receive messages published to a topic, you must subscribe an endpoint (such as AWS Lambda, Amazon SQS, HTTP/S, or an email address) to the topic. When you subscribe an endpoint to a topic and confirm the subscription, the endpoint begins to receive messages published to the associated topic. lets see how we can subscribe to SNS.
Create project in anypoint studio and configure the listener to trigger the flow
Drag and drop subscribe operation and provide the connector configuration
Configure the topic arn,protocol and endpoint
Topic ARN: ARN of the topic you want to subscribe to
To get the topic arn you can get the arn value from amazon SNS Service as shown below
Protocol: you can configure the different other protocol SMS,EMAIL,HTTP,SQS etc
Endpoint: Configure that you want to receive notifications
Deploy the project and trigger to test from soapui
You can see the message as pending confirmation
In our case I have configured the email as a endpoint, I need to confirm the subscription from email
Email has received to confirm the subscription
Once you click on the subscription below message is displayed
Once you confirm the subscription ,the endpoint begins to receive messages published to the associated topic.
Sample application: subscribe endpoint sample application
Soap ui sample project: SubscribeEndpoint-soapui-project sample project