예제 #1
0
        public static MSMQ.MessageQueue GetOrAddQueue(Uri uri, out QueueDetails details)
        {
            details = default(QueueDetails);
            if (uri == null)
            {
                return(null);
            }

            details = UriToQueueName(uri);
            if (!details.Valid)
            {
                return(null);
            }

            var q = (MSMQ.MessageQueue)Queues.Get(details.QueueName);

            if (q == null)
            {
                q = new MSMQ.MessageQueue(details.QueueName);
                Queues.AddOrGetExisting(details.QueueName, q, new CacheItemPolicy {
                    SlidingExpiration = TimeSpan.FromMinutes(20)
                });
            }
            return((MSMQ.MessageQueue)q);
        }
예제 #2
0
 public MsmqMessaging(Uri address, MSMQ.MessageQueue queue, QueueDetails details) : base(queue, details.Recoverable)
 {
     if (address == null)
     {
         throw new ArgumentNullException(nameof(address));
     }
     Address   = address;
     _receiver = Receiver.Create(queue, _isTransactional, details.Subject);
 }
 public MsmqMultiSubjectMessaging(Uri address, MSMQ.MessageQueue queue, QueueDetails details) : base(queue, details.Recoverable)
 {
     if (address == null)
     {
         throw new ArgumentNullException(nameof(address));
     }
     Address         = address;
     _receiver       = new MultiFilteredReciever(queue, _isTransactional, _subscriptions);
     _defaultSubject = details.Subject;
 }