Пример #1
0
        static void Main(string[] args)
        {
            QueueParams param = new QueueParams(ConfigurationManager.AppSettings.Get("RabbitMQServerIP"), "Xml-Queue");
            QueueObj    Qobj  = QueueObj.GetQueueObj(param);

            Qobj.ConsumeMessages <string>(SomeMethods.MessageProcces, true);
        }
Пример #2
0
        static void Main(string[] args)
        {
            QueueParams param = new QueueParams(ConfigurationManager.AppSettings.Get("RabbitMQServerIP"), "Xml-Queue");
            QueueObj    Qobj  = QueueObj.GetQueueObj(param);

            string address    = RequestApi.AddressForm(1);
            int    pageAmount = RequestApi.GetPageAmount(address);

            for (int i = 1; i <= pageAmount; i++)
            {
                IEnumerable <string> idList = RequestApi.RequestIdList(address);

                foreach (string id in idList)
                {
                    address = id.AddressForm();
                    XmlDocument xDoc      = RequestApi.HttpRequest(address);
                    string      xmlString = xDoc.OuterXml;
                    Qobj.PublishMessage <string>(xmlString);
                }
                Console.WriteLine($"Выполнена загрузка документов со страницы {i}");
                address = RequestApi.AddressForm(i + 1);
            }
            Console.ReadKey();
        }
Пример #3
0
        public void DataInit()
        {
            QueueParams param = new QueueParams("localhost", "Test-Queue");

            Qobj = QueueObj.GetQueueObj(param);
        }