in Dotnet/aws-iot-http-sigv4-dotnet-app/aws-iot-http-sigv4-dotnet-app/Program.cs [12:30]
static void Main(string[] args)
{
while (true)
{
try
{
string jsonPayload = JsonHelper.GenerateRandomJsonPayload();
string topic = "mytopic";
Console.WriteLine($"Publishing message {jsonPayload} to {topic}..");
PublishMessageToTopic(jsonPayload, topic);
Thread.Sleep(5000);
}
catch (Exception e)
{
// log the error and continue to publish
Logger.LogError(e.Message);
}
}
}