private async Task ProcessStockQuery(StockQueryDTO stock)
        {
            try
            {
                var result = await _stooqService.GetStock(stock.StockCode);

                if (!result.Succeeded)
                {
                    throw new NotFoundException("The requested stock could not be retrieved from the Stooq service");
                }
                _stockResponse.Publish(new StockResponseDTO(result.Content));
            }
            catch (Exception ex)
            {
                _stockResponse.Publish(new StockResponseDTO(ex));
            }
        }
Esempio n. 2
0
 public void Publish(StockQueryDTO stockCode)
 {
     base.Publish(stockCode, "amq.direct");
 }