public TransactionalRouter(string inputQueueFormatName, Postman sender, Func <Message, QueueWriter> route)
     : base(inputQueueFormatName, sender, route)
 {
     Contract.Requires(sender != null);
     Contract.Requires(route != null);
     Contract.Requires(inputQueueFormatName != null);
 }
示例#2
0
        public RequestReply(string requestQueueFormantName, string replyQueueFormatName, Postman postman)
        {
            Contract.Requires(postman != null);
            Contract.Requires(requestQueueFormantName != null);
            Contract.Requires(replyQueueFormatName != null);

            _requestQueue  = new QueueWriter(requestQueueFormantName);
            _responseQueue = new QueueReader(replyQueueFormatName);
            _postman       = postman;
        }
示例#3
0
        /// <summary>
        /// Sends a <paramref name="message"/> to the <paramref name="queue"/> and waits for it to be delivered.
        /// Waits for responses from all queues when the <paramref name="queue"/> is a multi-element format name.
        /// Note that the transaction MUST commit before the acknowledgements are received.
        /// </summary>
        /// <returns>Task that completes when the message has been delivered</returns>
        /// <exception cref="TimeoutException">Thrown if the message does not reach the queue before the <see cref="ReachQueueTimeout"/> has been reached</exception>
        /// <exception cref="AcknowledgmentException">Thrown if something bad happens, e.g. message could not be sent, access denied, the queue was purged, etc</exception>
        public static Task DeliverAsync(this QueueWriter queue, Message message, Postman postman, QueueTransaction transaction = null)
        {
            Contract.Requires(queue != null);
            Contract.Requires(message != null);
            Contract.Requires(postman != null);
            Contract.Requires(transaction == null || transaction == QueueTransaction.None || transaction == QueueTransaction.Single);

            var t = postman.RequestDelivery(message, queue, transaction);

            return(postman.WaitForDeliveryAsync(t));
        }
示例#4
0
        protected Router(string inputQueueFormatName, Postman sender, Func <Message, QueueWriter> route)
        {
            Contract.Requires(inputQueueFormatName != null);
            Contract.Requires(sender != null);
            Contract.Requires(route != null);

            InputQueueFormatName = inputQueueFormatName;
            Sender            = sender;
            _route            = route;
            BadMessageHandler = MoveToPoisonSubqueue;
        }
示例#5
0
 public static Task WaitToBeReceivedAsync(this Tracking tracking, Postman postman) => postman.WaitToBeReceivedAsync(tracking);
示例#6
0
 public static void WaitToBeReceived(this Tracking tracking, Postman postman) => postman.WaitToBeReceived(tracking);
示例#7
0
 public static Task WaitForDeliveryAsync(this Tracking tracking, Postman postman) => postman.WaitForDeliveryAsync(tracking);
示例#8
0
 public static void WaitForDelivery(this Tracking tracking, Postman postman) => postman.WaitForDelivery(tracking);
示例#9
0
 public static Tracking RequestDelivery(this QueueWriter queue, Message message, Postman postman, QueueTransaction txn = null) => postman.RequestDelivery(message, queue, txn);