Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Amazon Simple Notification Service

DZone's Guide to

Amazon Simple Notification Service

Let's take a look at the Anypoint Amazon SNS Connector and explore how it enables you to build distributed web-enabled applications.

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

Introduction

The Anypoint Amazon SNS Connector provides connectivity to the Amazon Simple Notification Service (Amazon SNS) API, enabling you to build distributed web-enabled applications. Mule applications can use the Amazon SNS Connector to easily push real-time notification messages to interested subscribers over multiple delivery protocol.

Prerequisites

To be able to use the Amazon SNS Connector, you must have the following:

  • Access to Amazon Web Services — SNS.
  • To access AWS with the connector, you will need the credentials in the form of IAM.
  • Anypoint Studio — Enterprise Edition.

Setting the Global Configuration

  • Click the Global Elements tab at the base of the canvas.
  • On the Global Mule Configuration Elements screen, click Create.
  • In the Choose Global Type wizard, expand Connector Configuration and select Amazon SNS: Configuration and click Ok.

Image title

Configure the parameters according to the instructions below.

  • Enter a name for the configuration to reference it.
  • Alphanumeric text string that uniquely identifies the user who owns the account.
  • Key that plays the role of a password.
  • Set the topic region endpoint.
  • Topic ARN to test the connectivity.

Image title

By using this connector, we can perform the below operations.

  • Add Permission
  • Confirm Subscription
  • Create Platform Application
  • Create Platform Endpoint
  • Create Topic
  • Delete Endpoint
  • Delete Platform Application
  • Delete Topic
  • Get Endpoint Attributes
  • Get Platform Application Attributes
  • Get Subscription Attributes
  • Get Topic Attributes
  • List Endpoint By Platform Application
  • List Platform Application
  • List Subscriptions By Topic
  • List Subscription
  • List Topics
  • Publish
  • Remove Permission
  • Set Endpoint Attributes
  • Set Platform Application Attributes
  • Set Subscription Attributes
  • Set Topic Attributes
  • Subscribe
  • Unsubscribe

Example Use Case

Create Operation:

Image title

We have to provide Access Key, Secret Key, Region endpoint and global Topic ARN name.

Image title

Image title

Example data:

{

"topicName":"MuledemoTopic"

}

Output: Creates topic in AWS SNS

Publish Operation:

Image title

Also, we have to pass, Topic ARN, Message, Subject, and Message Structure details.

Image title

Just like Create Topic operation, we have to provide Access Key, Secret Key, Region endpoint and global Topic ARN name.

Image title

If we publish data to SNS, it will retrive message id for that particular ARN.

Example data:

{

"arn":"arn:aws:sns:us-east-1:204899602921:MuledemoTopic5",

"message":"welcome to AWS",

"subject":"welcome"

}

Output: we receive message ID for that particular arn in return

Delete Topic:

Image title

We can use similar configurations like publish/Create topic operation. Here, we need to mention topic ARN for which we want to delete.

Image title

Thanks, and let me know your thoughts in the comments below.

Download A Buyer's Guide to Application and Data Integration, your one-stop-shop for research, checklists, and explanations for an application and data integration solution.

Topics:
mulesoft ,integration ,amazon ,notification service tutorial ,amazon sns connector ,tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}