use of com.amazonaws.services.sns.model.SubscribeResult in project glacier-cli by carlossg.
the class Glacier method setupSNS.
private QueueConfig setupSNS(QueueConfig config, String snsTopicName) {
CreateTopicRequest request = new CreateTopicRequest().withName(snsTopicName);
CreateTopicResult result = snsClient.createTopic(request);
config.snsTopicARN = result.getTopicArn();
SubscribeRequest request2 = new SubscribeRequest().withTopicArn(config.snsTopicARN).withEndpoint(config.sqsQueueARN).withProtocol("sqs");
SubscribeResult result2 = snsClient.subscribe(request2);
config.snsSubscriptionARN = result2.getSubscriptionArn();
return config;
}
Aggregations