Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Cyan;
            var service = new ConsumerService();

            service.Consume("TOPPER", "NO", "IDNO2");
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Green;
            var service = new ConsumerService();

            service.Consume("mytopic", "G", "G");
        }
Ejemplo n.º 3
0
    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));
    }
Ejemplo n.º 4
0
        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();
        }