protected override void WorkStop()
 {
     consumer?.Abort();
     consumer = null;
     deliveryTags?.Clear();
     deliveryTags = null;
 }
 public RabbitMqContinuousConsumer(BoundedContext boundedContext, ISerializer serializer, IConnectionFactory connectionFactory, ISubscriberCollection <T> subscriberCollection)
     : base(subscriberCollection)
 {
     this.deliveryTags = new Dictionary <Guid, ulong>();
     this.serializer   = serializer;
     this.consumer     = new QueueingBasicConsumerWithManagedConnection(connectionFactory, subscriberCollection, boundedContext);
 }
 public RabbitMqContinuousConsumer(string consumerName, ISerializer serializer, IConnectionFactory connectionFactory, SubscriptionMiddleware middleware) : base(middleware)
 {
     this.deliveryTags = new Dictionary <Guid, ulong>();
     this.serializer   = serializer;
     this.consumer     = new QueueingBasicConsumerWithManagedConnection(connectionFactory, middleware, consumerName);
 }