示例#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));
        }
        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;
 }
 private MsmqConnector(MessageQueue queue, MsmqAddress address, bool enlist)
 {
     this.queue   = queue;
     this.address = address;
     this.enlist  = enlist;
 }