Ejemplo n.º 1
0
        public long PublishEventSync(int quantity)
        {
            var sw = Stopwatch.StartNew();

            for (var i = 0; i < quantity; i++)
            {
                _messageBus.PublishEvent(new TestEvent
                {
                    Id        = Guid.NewGuid(),
                    Timestamp = DateTimeOffset.Now
                });
            }

            return(sw.ElapsedMilliseconds);
        }
Ejemplo n.º 2
0
        public ActionResult Index(int quantity = 1)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (int i = 0; i < quantity; i++)
            {
                _messageBus.PublishEvent(new TestEvent
                {
                    Id        = Guid.NewGuid(),
                    Timestamp = DateTimeOffset.Now
                });
            }
            stopwatch.Stop();
            return(Content(stopwatch.ElapsedMilliseconds.ToString()));
        }
Ejemplo n.º 3
0
 public void PublishEvent <T>(T @event) where T : IEvent
 {
     _rabbitMqClient.PublishEvent(@event);
 }
Ejemplo n.º 4
0
 public void Publish <TMessage>(TMessage message) =>
 _rabbitMqClient.PublishEvent(message);
Ejemplo n.º 5
0
 public void PublishEvent <T>(T @event) where T : IIntegrationEvent
 {
     _rabbitMqClient.PublishEvent(GetTypeName(typeof(T)), @event);
 }