|
@@ -0,0 +1,53 @@
|
|
|
+namespace receive
|
|
|
+{
|
|
|
+ using System;
|
|
|
+
|
|
|
+ class Program
|
|
|
+ {
|
|
|
+ static void Main(string[] args)
|
|
|
+ {
|
|
|
+ string url = "amqp://localhost:61616";
|
|
|
+ string addr = "sampleTopic";
|
|
|
+
|
|
|
+ bool durable = false;
|
|
|
+ string cid = "";
|
|
|
+ if (args.Length > 0) {
|
|
|
+ durable = bool.Parse(args[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (durable && args.Length > 1) {
|
|
|
+ cid = args[1];
|
|
|
+ } else if (durable) {
|
|
|
+ cid = Guid.NewGuid().ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (durable) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Console.WriteLine("Created new " + (durable ? "" : "non-") + "durable subscriber" + (durable ? " with ID " + cid : ""));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (durable) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Console.WriteLine("Receiving random metrics from " + url + "/" + addr);
|
|
|
+ while (true) {
|
|
|
+
|
|
|
+
|
|
|
+ Console.WriteLine("Got: " + null);
|
|
|
+
|
|
|
+
|
|
|
+ System.Threading.Thread.Sleep(1000);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|