What is Amazon SNS And How To Integrate With Java
Posted By : Vikash Patwal | 21-Sep-2018
Amazon Simple Notification Service (Amazon SNS) is a web benefit that directions and deals with the conveyance or sending of messages to buying in endpoints or customers. In Amazon SNS, there are two sorts of customers—distributers and supporters—additionally alluded to as makers and buyers.
When utilizing Amazon SNS, you (as the proprietor) make a subject and control access to it by characterizing arrangements that figure out which distributers and endorsers can speak with the theme. A
SNS Class-:
public static void pushSNSMessage(String lambdaName,String message)
{
//Aws credentianl for access AWS Console
AmazonSNSClient snsClient = new AmazonSNSClient(new BasicAWSCredentials(ApiConstant.S3_ACCESS_KEY, ApiConstant.S3_SECRET_KEY));
snsClient.setRegion(Region.getRegion(Regions.EU_WEST_1));
//create a topic
CreateTopicRequest createTopicRequest = new CreateTopicRequest("new-Notifications");
CreateTopicResult createTopicResult = snsClient.createTopic(createTopicRequest);
//publish topic
PublishRequest publishRequest = new PublishRequest(createTopicResult.getTopicArn(), "");
publishRequest.setSubject(lambdaName);
publishRequest.setMessage(message);
snsClient.publish(publishRequest);
}
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Vikash Patwal
Vikash Patwal is Masters in Computer Applications and good in Java , he is hardworking team player.