public SubscriptionInfo(SubscriptionAction subscriptionAction, EasyNetQConsumer consumer, MessageCallback callback, bool modelIsSingleUse, IModel channel)
 {
     SubscriptionAction = subscriptionAction;
     Consumer           = consumer;
     Callback           = callback;
     ModelIsSingleUse   = modelIsSingleUse;
     Channel            = channel;
 }
        public DefaultBasicConsumer CreateConsumer(
            SubscriptionAction subscriptionAction, 
            IModel model, 
            bool modelIsSingleUse, 
            MessageCallback callback)
        {
            var consumer = new EasyNetQConsumer(model, queue);
            var consumerTag = Guid.NewGuid().ToString();
            consumer.ConsumerTag = consumerTag;
            subscriptions.Add(consumerTag, new SubscriptionInfo(subscriptionAction, consumer, callback, modelIsSingleUse, model));

            return consumer;
        }
        public DefaultBasicConsumer CreateConsumer(
            SubscriptionAction subscriptionAction,
            IModel model,
            bool modelIsSingleUse,
            MessageCallback callback)
        {
            var consumer    = new EasyNetQConsumer(model, queue);
            var consumerTag = Guid.NewGuid().ToString();

            consumer.ConsumerTag = consumerTag;
            subscriptions.Add(consumerTag, new SubscriptionInfo(subscriptionAction, consumer, callback, modelIsSingleUse, model));

            return(consumer);
        }
        public DefaultBasicConsumer CreateConsumer(
            SubscriptionAction subscriptionAction,
            IModel model,
            bool modelIsSingleUse,
            MessageCallback callback)
        {
            var consumer = new EasyNetQConsumer(model, queue)
            {
                ConsumerTag = subscriptionAction.Id
            };

            if (subscriptions.ContainsKey(consumer.ConsumerTag))
            {
                logger.DebugWrite("Removing existing subscription with ConsumerTag: " + consumer.ConsumerTag);
                subscriptions.Remove(consumer.ConsumerTag);
            }

            subscriptions.Add(consumer.ConsumerTag, new SubscriptionInfo(subscriptionAction, consumer, callback, modelIsSingleUse, model));
            return(consumer);
        }
 public SubscriptionInfo(SubscriptionAction subscriptionAction, EasyNetQConsumer consumer, MessageCallback callback, bool modelIsSingleUse, IModel channel)
 {
     SubscriptionAction = subscriptionAction;
     Consumer = consumer;
     Callback = callback;
     ModelIsSingleUse = modelIsSingleUse;
     Channel = channel;
 }
        public DefaultBasicConsumer CreateConsumer(
            SubscriptionAction subscriptionAction,
            IModel model, 
            bool modelIsSingleUse, 
            MessageCallback callback)
        {
            var consumer = new EasyNetQConsumer(model, queue);
            consumer.ConsumerTag = subscriptionAction.Id;

            if (subscriptions.ContainsKey(consumer.ConsumerTag))
            {
                logger.DebugWrite("Removing existing subscription with ConsumerTag: " + consumer.ConsumerTag);
                subscriptions.Remove(consumer.ConsumerTag);
            }

            logger.DebugWrite("Adding subscription with ConsumerTag: " + consumer.ConsumerTag);
            subscriptions.Add(consumer.ConsumerTag, new SubscriptionInfo(subscriptionAction, consumer, callback, modelIsSingleUse, model));

            return consumer;
        }