/// <summary> /// Initializes a new instance of the AzureQueueListener class /// </summary> /// <param name="queue">target Azure queue</param> /// <param name="handler">message handler</param> /// <param name="exceptionHandler">exception handler</param> /// <param name="subscription">subscription size that indicates maximum number of message can be handled via message handler concurrently</param> public AzureQueueListener(CloudQueue queue, MessageHandler handler, ExceptionHandler exceptionHandler, int subscription) { Debug.Assert(queue != null, "queue"); Debug.Assert(handler != null, "handler"); Debug.Assert(subscription > 0, "subscription"); this.queue = queue; this.handler = handler; this.exceptionHandler = exceptionHandler; this.semSubscription = new SemaphoreSlim(subscription); this.messageRetriever = new MessageRetriever(queue, MessageRetrieveConcurrency, TimeSpan.FromMinutes(Constant.DataOperationTimeoutInMinutes), this.ReceiveMessages, null); }
public RestMSMessage Get(string pipeName, string messageName) { var retriever = new MessageRetriever(_pipeRepository); return(retriever.Retrieve(new Name(pipeName), Guid.Parse(messageName))); }