public void PushStatuses() { Console.WriteLine("PushStatuses"); if (_statuses.Count > 0) { var str = _statuses.Dequeue(); Console.WriteLine("SEND : " + str); _messengerMq.Publish(str); } }
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(); }