QueueClient Class
Represents the queue client object.
System.Object
Microsoft.ServiceBus.Messaging.MessageClientEntity
Microsoft.ServiceBus.Messaging.QueueClient
Microsoft.ServiceBus.Messaging.MessageClientEntity
Microsoft.ServiceBus.Messaging.QueueClient
Namespace: Microsoft.ServiceBus.Messaging
Assembly: Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
The QueueClient type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | IsClosed | Gets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.) |
![]() | MessagingFactory | Gets or sets the messaging factory. |
![]() | Mode | Gets the message receive mode when processing the received message. |
![]() | Path | Gets or sets the full path name of the queue. |
![]() | PrefetchCount | Gets or sets the number of messages that the queue receiver can simultaneously request. |
![]() | ThisLock | Gents an object used for locking the MessageClientEntity instance. (Inherited from MessageClientEntity.) |
| Name | Description | |
|---|---|---|
![]() | Abandon(Guid) | Discards the message and relinquishes the message lock ownership. |
![]() | Abandon(Guid, IDictionary<String, Object>) | Discards the message and relinquishes the message lock ownership. |
![]() | AbandonAsync(Guid) | Asynchronously discards the message and relinquishes the message lock ownership. |
![]() | AbandonAsync(Guid, IDictionary<String, Object>) | Asynchronously discards the message and relinquishes the message lock ownership. |
![]() | Abort | Aborts the message client entity and puts its status into a closing state. (Inherited from MessageClientEntity.) |
![]() | AcceptMessageSession() | Accepts a message session that allows grouping of related messages for processing in a single transaction. |
![]() | AcceptMessageSession(String) | Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier. |
![]() | AcceptMessageSession(TimeSpan) | Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. |
![]() | AcceptMessageSession(String, TimeSpan) | Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time. |
![]() | AcceptMessageSessionAsync() | Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction. |
![]() | AcceptMessageSessionAsync(String) | Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier. |
![]() | AcceptMessageSessionAsync(TimeSpan) | Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. |
![]() | AcceptMessageSessionAsync(String, TimeSpan) | Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time. |
![]() | BeginAbandon(Guid, AsyncCallback, Object) | Begins an asynchronous operation to abandon the message and relinquish its lock. |
![]() | BeginAbandon(Guid, IDictionary<String, Object>, AsyncCallback, Object) | Begins an asynchronous operation to abandon the message and relinquish its lock. |
![]() | BeginAcceptMessageSession(AsyncCallback, Object) | Begin an asynchronous operation to accept a message session. |
![]() | BeginAcceptMessageSession(String, AsyncCallback, Object) | Begin an asynchronous operation to accept a message session. |
![]() | BeginAcceptMessageSession(TimeSpan, AsyncCallback, Object) | Begin an asynchronous operation to accept a message session. |
![]() | BeginAcceptMessageSession(String, TimeSpan, AsyncCallback, Object) | Begin an asynchronous operation to accept a message session. |
![]() | BeginClose | Begins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.) |
![]() | BeginComplete | Begins an asynchronous operation to complete processing of a message. |
![]() | BeginCompleteBatch | Begins an asynchronous operation to complete processing of a message batch. |
![]() | BeginDeadLetter(Guid, AsyncCallback, Object) | Begins an asynchronous operation to move a message to the dead letter queue. |
![]() | BeginDeadLetter(Guid, IDictionary<String, Object>, AsyncCallback, Object) | Begins an asynchronous operation to move a message to the dead letter queue. |
![]() | BeginDeadLetter(Guid, String, String, AsyncCallback, Object) | Begins an asynchronous operation to move a message to the dead letter queue. |
![]() | BeginDefer(Guid, AsyncCallback, Object) | Begins an asynchronous operation to suspend processing of a message. |
![]() | BeginDefer(Guid, IDictionary<String, Object>, AsyncCallback, Object) | Begins an asynchronous operation to suspend processing of a message. |
![]() | BeginGetMessageSessions(AsyncCallback, Object) | Begins an asynchronous operation to get the message sessions. |
![]() | BeginGetMessageSessions(DateTime, AsyncCallback, Object) | Begins an asynchronous operation to get the message sessions. |
![]() | BeginPeek(AsyncCallback, Object) | Begins an asynchronous operation to peek a message. |
![]() | BeginPeek(Int64, AsyncCallback, Object) | Begins an asynchronous operation to peek a message. |
![]() | BeginPeekBatch(Int32, AsyncCallback, Object) | Begins an asynchronous operation to peek a batch of messages. |
![]() | BeginPeekBatch(Int64, Int32, AsyncCallback, Object) | Begins an asynchronous operation to peek a batch of messages. |
![]() | BeginReceive(AsyncCallback, Object) | Begins an asynchronous operation to receive a message. |
![]() | BeginReceive(Int64, AsyncCallback, Object) | Begins an asynchronous operation to receive a message. |
![]() | BeginReceive(TimeSpan, AsyncCallback, Object) | Begins an asynchronous operation to receive a message. |
![]() | BeginReceiveBatch(IEnumerable<Int64>, AsyncCallback, Object) | Begins an asynchronous operation to receive a message batch. |
![]() | BeginReceiveBatch(Int32, AsyncCallback, Object) | Begins an asynchronous operation to receive a message batch. |
![]() | BeginReceiveBatch(Int32, TimeSpan, AsyncCallback, Object) | Begins an asynchronous operation to receive a message batch. |
![]() | BeginSend | Begins an asynchronous operation to send a message. |
![]() | BeginSendBatch | Begins an asynchronous operation to send a message batch. |
![]() | Close | Closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.) |
![]() | CloseAsync | Asynchronously closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.) |
![]() | Complete | Completes processing of a message. |
![]() | CompleteAsync | Asynchronously completes processing of a message. |
![]() | CompleteBatch | Completes processing of a message batch. |
![]() | CompleteBatchAsync | Asynchronously completes processing of a message batch. |
![]() ![]() | Create(String) | Creates a new copy of QueueClient with specified path. |
![]() ![]() | Create(String, ReceiveMode) | Creates a new copy of QueueClient with specified path and mode. |
![]() ![]() | CreateFromConnectionString(String, String) | Creates a new copy of QueueClient from connection string with specified path. |
![]() ![]() | CreateFromConnectionString(String, String, ReceiveMode) | Creates a new copy of QueueClient from connection string with specified path and mode. |
![]() | DeadLetter(Guid) | Moves the undelivered message to the dead letter queue. |
![]() | DeadLetter(Guid, IDictionary<String, Object>) | Moves the undelivered message to the dead letter queue. |
![]() | DeadLetter(Guid, String, String) | Moves the undelivered message to the dead letter queue. |
![]() | DeadLetterAsync(Guid) | Asynchronously moves the undelivered message to the dead letter queue. |
![]() | DeadLetterAsync(Guid, IDictionary<String, Object>) | Asynchronously moves the undelivered message to the dead letter queue. |
![]() | DeadLetterAsync(Guid, String, String) | Asynchronously moves the undelivered message to the dead letter queue. |
![]() | Defer(Guid) | Suspends the processing of a message. |
![]() | Defer(Guid, IDictionary<String, Object>) | Suspends the processing of a message. |
![]() | DeferAsync(Guid) | Asynchronously suspends the processing of a message. |
![]() | DeferAsync(Guid, IDictionary<String, Object>) | Asynchronously suspends the processing of a message. |
![]() | EndAbandon | Finishes an asynchronous operation to abandon the message and relinquish its lock. |
![]() | EndAcceptMessageSession | Finishes an asynchronous operation to accept a message session that allows grouping of related messages for processing in a single transaction. |
![]() | EndClose | Finishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.) |
![]() | EndComplete | Finishes an asynchronous operation to complete processing of a message. |
![]() | EndCompleteBatch | Finishes an asynchronous operation to complete processing of a message batch. |
![]() | EndDeadLetter | Finishes an asynchronous operation to move message to the dead letter queue. |
![]() | EndDefer | Finishes an asynchronous operation to suspend processing of a message. |
![]() | EndGetMessageSessions | Ends an asynchronous operation to get the message sessions. |
![]() | EndPeek | Ends an asynchronous operation to peek a message. |
![]() | EndPeekBatch | Ends an asynchronous operation to peek a batch of messages. |
![]() | EndReceive | Finishes an asynchronous operation to receive a message. |
![]() | EndReceiveBatch | Finishes an asynchronous operation to receive a message batch. |
![]() | EndSend | Finishes an asynchronous operation to send a message. |
![]() | EndSendBatch | Finishes an asynchronous operation to send a message batch. |
![]() | Equals | (Inherited from Object.) |
![]() | Fault | Puts the message client entity into a faulted state. (Inherited from MessageClientEntity.) |
![]() | Finalize | (Inherited from Object.) |
![]() ![]() | FormatDeadLetterPath | Builds a format name from the specified dead letter queue path. |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetMessageSessions() | Gets the message sessions, enabling you to browse sessions on queues. |
![]() | GetMessageSessions(DateTime) | Retrieves all message sessions whose session state was updated since lastUpdatedTime. |
![]() | GetMessageSessionsAsync() | Asynchronously gets the message sessions, enabling you to browse sessions on queues. |
![]() | GetMessageSessionsAsync(DateTime) | Asynchronously retrieves all message sessions whose session state was updated since lastUpdatedTime. |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | OnAbort | Executes upon calling the Abort event. (Overrides MessageClientEntity.OnAbort().) |
![]() | OnBeginAcceptMessageSession | Executes upon calling the BeginAcceptMessageSession operation. |
![]() | OnBeginClose | Executes when the Close operation is called. (Overrides MessageClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).) |
![]() | OnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object) | Executes the begin create receiver action. |
![]() | OnBeginCreateReceiver(String, ReceiveMode, TimeSpan, AsyncCallback, Object) | Executes the begin create receiver action. |
![]() | OnBeginCreateSender | Executes the begin create sender action. |
![]() | OnBeginGetMessageSessions | Executes the BeginGetMessageSessions action. |
![]() | OnBeginOpen | Executes upon calling the operation to begin to open the message client entity. (Inherited from MessageClientEntity.) |
![]() | OnClose | Executes upon calling the Close action. (Overrides MessageClientEntity.OnClose(TimeSpan).) |
![]() | OnClosed | Occurs when the message client entity is transitioned into a closing state. (Inherited from MessageClientEntity.) |
![]() | OnEndAcceptMessageSession | Executes upon calling the EndAcceptMessageSession operation. |
![]() | OnEndClose | Executes the end close action. (Overrides MessageClientEntity.OnEndClose(IAsyncResult).) |
![]() | OnEndCreateReceiver | Executes the end create receiver action. |
![]() | OnEndCreateSender | Executes the end create sender action. |
![]() | OnEndGetMessageSessions | Executes the end get message action. |
![]() | OnEndOpen | Executes upon calling the operation to end to open the message client entity. (Inherited from MessageClientEntity.) |
![]() | OnFaulted | Executes upon calling the Fault operation. (Inherited from MessageClientEntity.) |
![]() | OnMessage(Action<BrokeredMessage>) | Processes a message in an event-driven message pump. |
![]() | OnMessage(Action<BrokeredMessage>, OnMessageOptions) | Processes a message in an event-driven message pump, with the given set of OnMessageOptions options. |
![]() | OnMessageAsync(Func<BrokeredMessage, Task>) | Asynchronously processes a message. |
![]() | OnMessageAsync(Func<BrokeredMessage, Task>, OnMessageOptions) | Asynchronously processes a message. |
![]() | OnOpen | Executes upon calling the operation to open the message client entity. (Inherited from MessageClientEntity.) |
![]() | OnOpened | Executes when the message client entity is opened. (Inherited from MessageClientEntity.) |
![]() | Peek() | Returns without removing the first message in the queue. |
![]() | Peek(Int64) | Returns without removing the first message in the queue. |
![]() | PeekAsync() | Asynchronously returns without removing the first message in the queue. |
![]() | PeekAsync(Int64) | Asynchronously returns without removing the first message in the queue. |
![]() | PeekBatch(Int32) | Peeks a batch of message. |
![]() | PeekBatch(Int64, Int32) | Peeks a batch of messages. |
![]() | PeekBatchAsync(Int32) | Asynchronously peeks a batch of message. |
![]() | PeekBatchAsync(Int64, Int32) | Asynchronously peeks a batch of message. |
![]() | Receive() | Receives a message using the InternalReceiver(). |
![]() | Receive(Int64) | Receives a message using the InternalReceiver(). |
![]() | Receive(TimeSpan) | Receives a message using the InternalReceiver(). |
![]() | ReceiveAsync() | Asynchronously receives a message using the InternalReceiver(). |
![]() | ReceiveAsync(Int64) | Asynchronously receives a message using the InternalReceiver(). |
![]() | ReceiveAsync(TimeSpan) | Asynchronously receives a message using the InternalReceiver(). |
![]() | ReceiveBatch(IEnumerable<Int64>) | Receives a message batch. |
![]() | ReceiveBatch(Int32) | Receives a message batch. |
![]() | ReceiveBatch(Int32, TimeSpan) | Receives a message batch. |
![]() | ReceiveBatchAsync(IEnumerable<Int64>) | Asynchronously receives a message batch. |
![]() | ReceiveBatchAsync(Int32) | Asynchronously receives a message batch. |
![]() | ReceiveBatchAsync(Int32, TimeSpan) | Asynchronously receives a message batch. |
![]() | Send | Sends a message using the InternalSender(). |
![]() | SendAsync | Asynchronously sends a message using the InternalSender(). |
![]() | SendBatch | Sends a set of brokered messages (for batch processing). |
![]() | SendBatchAsync | Asynchronously sends a set of brokered messages (for batch processing). |
![]() | ThrowIfClosed | Throws an exception if the message client entity is closed. (Inherited from MessageClientEntity.) |
![]() | ThrowIfDisposed | Throws an exception if the message client entity is disposed. (Inherited from MessageClientEntity.) |
![]() | ThrowIfDisposedOrImmutable | Throws an exception if the client is disposed or immutable. (Inherited from MessageClientEntity.) |
![]() | ThrowIfDisposedOrNotOpen | Throws an exception if the client is disposed or not open. (Inherited from MessageClientEntity.) |
![]() | ThrowIfFaulted | Throws an exception if the client is faulted. (Inherited from MessageClientEntity.) |
![]() | ToString | (Inherited from Object.) |
// Create the MessagingFactory
MessagingFactory factory =
MessagingFactory.Create(myServiceBusNamespaceUri, SharedSecretTokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerKey));
//********************************************************************************
// Sending messages to a Queue
//********************************************************************************
// Create queue client
QueueClient myQueueClient = factory.CreateQueueClient("myQueue");
// Send messages
List <object>; Issues = new List <object>();
foreach (var issue in Issues)
{
myQueueClient.Send(new BrokeredMessage(issue));
}
// ... Recieve messages
for (int count = 0; count < MsgCount; count++)
{
var message = myQueueClient.Receive();
message.Complete();
}
