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);
 }
Beispiel #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;
        }
Beispiel #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));
        }
Beispiel #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;
        }
Beispiel #5
0
 public static Task WaitToBeReceivedAsync(this Tracking tracking, Postman postman) => postman.WaitToBeReceivedAsync(tracking);
Beispiel #6
0
 public static void WaitToBeReceived(this Tracking tracking, Postman postman) => postman.WaitToBeReceived(tracking);
Beispiel #7
0
 public static Task WaitForDeliveryAsync(this Tracking tracking, Postman postman) => postman.WaitForDeliveryAsync(tracking);
Beispiel #8
0
 public static void WaitForDelivery(this Tracking tracking, Postman postman) => postman.WaitForDelivery(tracking);
Beispiel #9
0
 public static Tracking RequestDelivery(this QueueWriter queue, Message message, Postman postman, QueueTransaction txn = null) => postman.RequestDelivery(message, queue, txn);