Пример #1
0
        public static MsmqConnector OpenReceive(MsmqAddress address, bool enlist)
        {
            var queue = new MessageQueue(address.Proprietary, QueueAccessMode.Receive);
            queue.MessageReadPropertyFilter.SetAll();

            Log.Info(Diagnostics.OpeningQueueForReceive, address, enlist);

            if (!enlist || queue.Transactional)
                return new MsmqConnector(queue, address, enlist);

            queue.Dispose();
            Log.Error(Diagnostics.NonTransactionalQueue, address.Canonical);
            throw new EndpointException(string.Format(CultureInfo.InvariantCulture, Diagnostics.NonTransactionalQueue, address.Canonical));
        }
Пример #2
0
        public static MsmqConnector OpenReceive(MsmqAddress address, bool enlist)
        {
            var queue = new MessageQueue(address.Proprietary, QueueAccessMode.Receive);

            queue.MessageReadPropertyFilter.SetAll();

            Log.Info(Diagnostics.OpeningQueueForReceive, address, enlist);

            if (!enlist || queue.Transactional)
            {
                return(new MsmqConnector(queue, address, enlist));
            }

            queue.Dispose();
            Log.Error(Diagnostics.NonTransactionalQueue, address.Canonical);
            throw new EndpointException(string.Format(CultureInfo.InvariantCulture,
                                                      Diagnostics.NonTransactionalQueue,
                                                      address.Canonical));
        }
Пример #3
0
 public static MsmqConnector OpenSend(MsmqAddress address, bool enlist)
 {
     var queue = new MessageQueue(address.Proprietary, QueueAccessMode.Send);
     Log.Info(Diagnostics.OpeningQueueForSend, address, enlist);
     return new MsmqConnector(queue, address, enlist);
 }
Пример #4
0
 private MsmqConnector(MessageQueue queue, MsmqAddress address, bool enlist)
 {
     this.queue = queue;
     this.address = address;
     this.enlist = enlist;
 }
Пример #5
0
 private MsmqConnector(MessageQueue queue, MsmqAddress address, bool enlist)
 {
     this.queue   = queue;
     this.address = address;
     this.enlist  = enlist;
 }