Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Created March 8, 2022 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awswithdotnet/d5cae333263662b6d249e7b753432b96 to your computer and use it in GitHub Desktop.
Save awswithdotnet/d5cae333263662b6d249e7b753432b96 to your computer and use it in GitHub Desktop.
sns Publisher Complete
using System;
using System.Threading.Tasks;
using Abstractions;
using MessageFormatters.CloudEventsMessageFormatter;
using SNSMessaging;
namespace Publisher
{
class Program
{
static async Task Main(string[] args)
{
IMessageFormatter<String, String> formatter = new CloudEventsMessageFormatter<String>();
IPublisher<String, Task> publisher = new SNSMessagePublisher(formatter);
String message = "This is a test from the .NET Publisher at " + DateTime.Now;
await publisher.Publish(message);
Console.WriteLine("Message Sent: " + message);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment