Пример #1
0
 public void MqManagerTest_Publish()
 {
     try
     {
         Assert.DoesNotThrow(() =>
         {
             mqManager.PublishMessage("helloRabbit");
         });
     }
     finally
     {
         mqManager.DeleteQueues();
         mqManager.DeleteExchange(exchangeName);
     }
 }
Пример #2
0
        public IActionResult Load([FromBody] HubMessage message)
        {
            if (ModelState.IsValid)
            {
                var newQueue = _mqManager.PublishMessage(message.ToString());
                if (!string.IsNullOrEmpty(newQueue))
                {
                    var worker = new Worker(new ConnStrProvider(newQueue, _provider.DbConnStr, _provider.MqConnStr),
                                            new MessageProcessor(new FlatDecisionMaker(_provider.DbConnStr)));
                    worker.Execute();
                    workers.Add(worker);
                }
            }

            return(Ok());
        }