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 | |
|---|---|---|
|
InternalReceiver | Gets or sets the message receiver for the queue. |
|
InternalSender | Gets or sets the message sender for the queue. |
|
IsClosed | Gets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.) |
|
IsSubQueue | Gets or sets a value that indicates whether the message receiver is created from a subqueue. |
|
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. |
| Name | Description | |
|---|---|---|
|
Abandon | 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. |
|
BeginAbandon | 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. |
|
BeginDeadLetter(Guid, 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 | Begins an asynchronous operation to suspend processing of a message. |
|
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. |
|
BeginSend | Begins an asynchronous operation to send a message. |
|
Close | Closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.) |
|
Complete | Completes processing of a message. |
|
DeadLetter(Guid) | Moves the undelivered message to the dead letter queue. |
|
DeadLetter(Guid, String, String) | Moves the undelivered message to the dead letter queue. |
|
Defer | 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. |
|
EndDeadLetter | Finishes an asynchronous operation to move message to the dead letter queue. |
|
EndDefer | Finishes an asynchronous operation to suspend processing of a message. |
|
EndReceive | Finishes an asynchronous operation to receive a message. |
|
EndSend | Finishes an asynchronous operation to send a message. |
|
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.) |
|
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. |
|
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. |
|
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.) |
|
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.) |
|
Receive() | Receives a message using the InternalReceiver. |
|
Receive(Int64) | Receives a message using the InternalReceiver. |
|
Receive(TimeSpan) | Receives a message using the InternalReceiver. |
|
Send | Sends a message using the InternalSender. |
|
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();
}