Commits

Nick Josevski committed 3cd90ed

added readme

  • Participants
  • Parent commits cafa778

Comments (0)

Files changed (4)

+
+A RabbitMQ demo app for a quick presentation at DDD Melbourne
+
+*Demo code created late on a Friday night, as of first 2 days of commits (29th of May) code is not optimal, and you can still see very rough attempts at refactoring it for a recursive approach.

RabbitLoop.sln.docstates

Binary file added.

RabbitLoop/Node.cs

 {
     public class DDDMelbourneRpcServer : SimpleRpcServer
     {
-        //TODO: put in colours!
-        /*
-         * 
-            Console.ResetColor();
-            Console.BackgroundColor = ConsoleColor.Red;
-            Console.ForegroundColor = ConsoleColor.White;
-         * */
         private readonly SimpleRpcClient rpcClient;
-        private readonly System.Guid identiifier;
+        private readonly System.Guid instanceId;
         private readonly int maximumRuns;
         private int msgSendCount;
 
         public DDDMelbourneRpcServer(int maxRuns, Subscription subscription, SimpleRpcClient client)
             : base(subscription)
         {
-            identiifier = Guid.NewGuid();
+            instanceId = Guid.NewGuid();
             msgSendCount = 0;
             maximumRuns = maxRuns;
-            Console.WriteLine("DDDMelbourneRpcServer {0} created", identiifier);
+            Console.WriteLine("DDDMelbourneRpcServer {0} created", instanceId);
             rpcClient = client;
             rpcClient.TimeoutMilliseconds = 2000;
         }
         
-        public override void HandleSimpleCast(bool isRedelivered, IBasicProperties requestProperties, byte[] body)
+        public override void HandleSimpleCast(Boolean isRedelivered, IBasicProperties requestProperties, byte[] body)
         {
             var incomingMessage = body.Deserialize() as AlphaMessage;
 
-            Console.WriteLine("Hello I am server instance {0}", identiifier);
+            Console.WriteLine("Hello I am server instance {0}", instanceId);
 
             Console.BackgroundColor = ConsoleColor.Red;
             Console.ForegroundColor = ConsoleColor.White;

Spawner/Program.cs

             ListBasedSpawn();
         }
 
+        /// <summary>
+        /// This is the working demo code, it's not an elegant solution but does create the loop and kicks off the first message
+        /// </summary>
         private static void ListBasedSpawn()
         {
             int totalRuns = 2;
             Console.ReadKey();
         }
 
+        private static void RecursiveSpawning()
+        {
+            
+        }
         private static void Spawn()
         {
             bool first = true;
             
         }
 
-        private static void AtoBtoCtoDRun()
+        /// <summary>
+        /// This is the most basic of attempts to ensure the wiring of the of RPC client and server is correct
+        /// </summary>
+        private static void CreteIndividualClientAndServer()
         {
             String exchange = "";
             var clientA = new SimpleRpcClient(model);
             
         }
 
-        private static void BuildClientAndServerAndExchangeAndModel(int run, char letter,
-            out String exchangeName,
-            //out String queueName,
-            //out DDDMelbourneRpcServer server,
-            out SimpleRpcClient client,
-            out Subscription sub)
+        private static void BuildClientAndServerAndExchangeAndModel(int run, char letter, out String exchangeName, out SimpleRpcClient client, out Subscription sub)
         {
             exchangeName = String.Format("comm.{0}.{1}", run, letter);
             //comm.a , comm.b ...
 
         }
 
-        private static IContainer _container;
+        //TODO: setup with Autofac... (a little overkill for the size of this demo)
+        //private static IContainer _container;
 
         /*
         public static void SetupWithAutofac(string exchangeName)