I had created the amazon sns client, provided the credential, set the region and create the publish message and use the publish method with it's attribute. it doesn't show any log or the exception and nothing happen on topic. Where i gone wrong? Thank you in advance.
Background
I had created lambda function using "implements RequestHandler {}". whenever error occur i want to push that error message to a desired topic basically trying to error handlig. Lambda function is working fine when there is no error and the publishing to topic is not used on the function it self. below code is applied only on error handle section. Thank you.
Here is my code:
String msg = "Message";
String ACCESS_KEY = "";
String SECRET_KEY = "";
BasicAWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY);
AmazonSNSClient snsClient = new AmazonSNSClient(new AWSStaticCredentialsProvider(credentials));
snsClient.setRegion(Region.getRegion(Regions.MyRegion));
String topicArn = "topic arn";
PublishRequest publishRequest = new PublishRequest(topicArn, msg);
snsClient.publish(publishRequest);