Пример #1
0
 private async Task AddToMulticastSubscriberQueues(NimbusMessage message)
 {
     await _topic.SubscriptionNames
     .Select(subscriptionName =>
     {
         var messageClone = Clone(message);
         var fullyQualifiedSubscriptionPath = InProcessTransport.FullyQualifiedSubscriptionPath(_topic.TopicPath, subscriptionName);
         //message.To = fullyQualifiedSubscriptionPath;  //FIXME find an elegant solution for this
         var subscriptionQueue = _messageStore.GetOrCreateMessageQueue(fullyQualifiedSubscriptionPath);
         var task = subscriptionQueue.Add(messageClone);
         return(task);
     })
     .WhenAll();
 }
Пример #2
0
        public InProcessQueueReceiver(string queuePath,
                                      ConcurrentHandlerLimitSetting concurrentHandlerLimit,
                                      InProcessMessageStore messageStore,
                                      IGlobalHandlerThrottle globalHandlerThrottle,
                                      ILogger logger) : base(concurrentHandlerLimit, globalHandlerThrottle, logger)
        {
            _queuePath    = queuePath;
            _messageStore = messageStore;

            _messageQueue = new ThreadSafeLazy <AsyncBlockingCollection <NimbusMessage> >(() => _messageStore.GetOrCreateMessageQueue(_queuePath));
        }
Пример #3
0
        public INimbusMessageReceiver GetQueueReceiver(string queuePath)
        {
            var messageQueue = _messageStore.GetOrCreateMessageQueue(queuePath);

            return(_container.ResolveWithOverrides <InProcessQueueReceiver>(queuePath, messageQueue));
        }