Amazon Simple Notification Service (SNS)
See Amazon Simple Notification Service (SNS) Developer Guide for general guidance using SNS.
API Access
The ISNSClient interface and its implementation TSNSClient provides access to all SNS operations.
program PublishMessageToTopic;
uses
AWS.SNS,
System.SysUtils;
var
Client: ISNSClient;
Request: ISNSPublishToTopicRequest;
Response: ISNSPublishResponse;
begin
try
Client := TSNSClient.Create;
Request := TSNSPublishToTopicRequest.Create(
'arn:aws:sns:us-east-1:123456789012:MyTopic',
'Your message here...'
);
Response := Client.Publish(Request);
if Response.IsSuccessful then
Writeln('Message was published!')
else
Writeln('Message was not published!');
except
on E: ESNSException do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.
Receiving Messages
When receiving messages to endpoints such as HTTP, a class for verifying the authenticity of messages is provided in TSNSMessageVerifier.
The TSNSMessageVerifier uses cryptographic functions provided by OpenSSL. When using this class, you must ensure OpenSSL is available. See the DocWiki article on OpenSSL for more details.