static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.Cyan; var service = new ConsumerService(); service.Consume("TOPPER", "NO", "IDNO2"); }
static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.Green; var service = new ConsumerService(); service.Consume("mytopic", "G", "G"); }
public ActionResult <ConsumerMessage> Consume(Guid consumerId, [Required] string token, [Required][Range(0, int.MaxValue)] int timeout) { var consumerMessage = _service.Consume(consumerId, token, TimeSpan.FromMilliseconds(timeout)); if (consumerMessage == null) { return(NoContent()); } return(new ActionResult <ConsumerMessage>(consumerMessage)); }
public static void Main(string[] args) { Thread.Sleep(TimeSpan.FromSeconds(60)); IUnitOfWork unitOfWork = new UnitOfWork(); ICassandraService cassandraService = new CassandraService(unitOfWork); IMessageService messageService = new MessageService(unitOfWork); INotifyService notify = new NotifyService(unitOfWork, messageService, cassandraService); IConsumerService consumer = new ConsumerService(unitOfWork, notify); consumer.Consume(); CreateHostBuilder(args).Build().Run(); }