123456789101112131415161718192021222324 |
- namespace send
- {
- using System;
- // TODO: import library
- class Program
- {
- static void Main(string[] args)
- {
- string url = "amqp://localhost:61616";
- string addr = "sampleTopic";
- // TODO: create and initialise messaging objects
- Console.WriteLine("Sending random metrics to " + url + "/" + addr);
- var rand = new Random();
- while (true) {
- // TODO: send a message containing a random number to the topic
- Console.WriteLine("Sent: " + rand.Next(10000).ToString());
- System.Threading.Thread.Sleep(1000);
- }
- }
- }
- }
|