public override Dictionary<string, string> handle(Message message) { Random rnd = new Random(); int accept = rnd.Next(0, 9); if (accept > 6) { Console.WriteLine("ExampleHandler1 handling message {0}: {1}", message.CorrelationId, message.Body); Thread.Sleep(rnd.Next(0, 5)); Console.WriteLine("Return"); message.ack(); Dictionary<string, string> response = new Dictionary<string, string>(); response.Add("message", String.Format("This is a Account Handler response to " + "message {0}", message.CorrelationId)); return response; } else { Console.WriteLine("Got no time for the message, will delay"); message.ack(); message.delay(); return new Dictionary<string, string>() { { "", "" } }; } }
public override Dictionary<string, string> handle(Message message) { Console.WriteLine("PortalMessageHandler handling message {0}: {1}", message.CorrelationId, message.Body); message.ack(); Dictionary<string, string> response = new Dictionary<string, string>(); response.Add("message", String.Format("This is a Account Handler response to " + "message {0}", message.CorrelationId)); return response; }
public override Dictionary<string, string> handle(Message message) { Console.WriteLine("AccountHandler handling message {0}: {1}", message.CorrelationId, message.Body); message.ack(); // add data to it's corresponding table RootObject individual_data = JsonConvert.DeserializeObject<RootObject>(message.Body); //insert data in local database insert_data(individual_data); Dictionary<string, string> response = new Dictionary<string, string>(); response.Add("message", String.Format("This is Individual Handler response to " + "message {0}", message.CorrelationId)); return response; }