Exemple #1
0
 internal void RemovePublisher(RabbitMQPublisher item)
 {
     lock (publishers)
     {
         publishers.Remove(item);
     }
 }
Exemple #2
0
        /// <summary>
        /// Creates a new instance of <see cref="RabbitMQPublisher"/>.
        /// </summary>
        /// <returns>Instance of <see cref="RabbitMQPublisher"/> ready to publish messages.</returns>
        public IPublisher CreatePublisher()
        {
            if (disposed)
            {
                throw new ObjectDisposedException(nameof(RabbitMQMessaging));
            }

            var(channel, channelEvents) = CreateChannel();

            var publisher = new RabbitMQPublisher(channel, channelEvents,
                                                  configuration.PublishConfirmationTimeoutMilliseconds, this, loggerFactory);

            publishers.Add(publisher);

            logger.LogInformation($"{nameof(CreatePublisher)}: Publisher created");

            return(publisher);
        }