Example #1
0
        /// <summary>
        /// To publish (direct) an event to a queue or exchange
        /// </summary>
        /// <param name="event"></param>
        public void Publish(IEvent @event)
        {
            IMessage       message   = @event.ToMessage();
            IList <string> exchanges = _eventRegistry.GetPublishingTarget(@event);

            foreach (string exchange in exchanges)
            {
                _publisher.Publish(exchange, message);
            }
        }