Skip to content

Instantly share code, notes, and snippets.

@bitsmuggler
Last active August 29, 2015 14:25
Show Gist options
  • Save bitsmuggler/976fa50e682dbee3f65c to your computer and use it in GitHub Desktop.
Save bitsmuggler/976fa50e682dbee3f65c to your computer and use it in GitHub Desktop.
Create an aws topic
private String createTopic(String topicName) {
try {
LOGGER.info("Create SNS Topic " + topicName);
CreateTopicRequest request = new CreateTopicRequest(topicName);
CreateTopicResult result = sns.createTopic(request);
// returning topic id
return result.getTopicArn();
} catch (Exception ex) {
LOGGER.error("Error at creating sns topic.", ex);
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment