Created
March 8, 2022 18:27
-
-
Save awswithdotnet/d5cae333263662b6d249e7b753432b96 to your computer and use it in GitHub Desktop.
sns Publisher Complete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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