public CompositeSubscription Subscribe <T>(PrioritySubscriptionOption <T> subscriptionOption)
        {
            TryConnectBeforeSubscribing();
            Func <IModel, IBasicConsumer> createConsumer = channel =>
                                                           _priorityConsumerManager.CreateConsumer(channel,
                                                                                                   subscriptionOption.SubscriptionName,
                                                                                                   subscriptionOption.MessageHandler,
                                                                                                   subscriptionOption.BatchSize <= 0
                                                                                      ? (ushort)1
                                                                                      : subscriptionOption.BatchSize);

            return(CreateSubscription <T>(subscriptionOption, createConsumer));
        }
Beispiel #2
0
        public void Subscribe <T>(string subscriptionName, uint maxPriorityLevel, Action <T> onReceiveMessage, Type comparerType = null)
        {
            TryConnectBeforeSubscribing();
            Func <IModel, string, IBasicConsumer> createConsumer = (channel, consumerTag) => _priorityConsumerManager.CreateConsumer(channel, subscriptionName, onReceiveMessage);

            CreateSubscription <T>(subscriptionName, maxPriorityLevel, createConsumer, comparerType);
        }