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