Exemplo n.º 1
0
        public async Task <IActionResult> PostOrder([FromBody] string message)
        {
            var order = factory.CreateOrder(message);

            var result = await orderManagerClient.SendOrderAsync(order);

            var okResult = new OkObjectResult(result);

            return(okResult);
        }
Exemplo n.º 2
0
        public void HandleBatch(int batchSize)
        {
            for (int i = 0; i < batchSize; i++)
            {
                var order = factory.CreateOrder($"Order{i}");

                try
                {
                    orderManagerClient.SendOrderAsync(order);
                }
                catch (Exception ex)
                {
                    logger.LogError(ex.Message);
                }
            }

            logger.LogDebug($"OrderHandler called with batch size = {batchSize}");
        }