public void Start() { Console.WriteLine("Start"); _timer_send.Start(); _timer_received.Start(); _messengerMq.Connection(); _messengerMq.MessageReceived += MessengerMqOnMessageReceived; }
static void Main(string[] args) { MqBro rabbitMq = new MqBro(); rabbitMq.Connection(); rabbitMq.MessageReceived += rabbitMq_MessageReceived; while (true) { Thread.Sleep(Sleep); rabbitMq.Received(RoutingKey); } rabbitMq.Disconnection(); }
static void Main(string[] args) { MqBro rabbitMq = new MqBro(); rabbitMq.Connection(); JsonParser jp = new JsonParser(new Organization() { Address = "aaaa", Discription = "BBBB" }, MethodType.AddOrganization); var json = JsonParser.Serialize(jp); while (true) { Thread.Sleep(Sleep); rabbitMq.Publish(json, RoutingKey); Console.WriteLine(json); } rabbitMq.Disconnection(); }