Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 private MsmqConnector(MessageQueue queue, MsmqAddress address, bool enlist)
 {
     this.queue = queue;
     this.address = address;
     this.enlist = enlist;
 }
Exemplo n.º 5
0
 private MsmqConnector(MessageQueue queue, MsmqAddress address, bool enlist)
 {
     this.queue   = queue;
     this.address = address;
     this.enlist  = enlist;
 }