SubscriptionClient Class
The anchor class used in run-time operations related to a topic subscription.
System.Object
Microsoft.ServiceBus.Messaging.MessageClientEntity
Microsoft.ServiceBus.Messaging.SubscriptionClient
Microsoft.ServiceBus.Messaging.MessageClientEntity
Microsoft.ServiceBus.Messaging.SubscriptionClient
Namespace: Microsoft.ServiceBus.Messaging
Assembly: Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
The SubscriptionClient type exposes the following members.
| Name | Description | |
|---|---|---|
|
InternalReceiver | Gets or sets the message receiver for the subscription. |
|
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 the messaging factory used to create this subscription client. |
|
Mode | Gets the message receive mode when processing the received message. |
|
Name | Gets the name of the subscription. |
|
PrefetchCount | Gets or sets the number of messages that the message receiver can simultaneously request. |
|
TopicPath | Gets the full pathname of the topic. |
| 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. |
|
AddRule(RuleDescription) | Adds a new rule to the Subscription using the specified rule description. |
|
AddRule(String, Filter) | Adds a rule to the current subscription with the specified name and filter expression. |
|
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. |
|
BeginAddRule(RuleDescription, AsyncCallback, Object) | Begins an asynchronous operation to add a new rule to the subscription. |
|
BeginAddRule(String, Filter, AsyncCallback, Object) | Begins an asynchronous operation to add a new rule to the subscription. |
|
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. |
|
BeginRemoveRule | Begins an asynchronous remove rule action. |
|
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. |
|
EndAddRule | Ends an asynchronous add rule operation. |
|
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. |
|
EndRemoveRule | Ends an asynchronous remove rule operation. |
|
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 deadletter path using the specified topic path and subscription name. |
|
FormatSubscriptionPath | Builds a format name subscription path using the specified topic path and subscription name. |
|
GetHashCode | (Inherited from Object.) |
|
GetType | (Inherited from Object.) |
|
MemberwiseClone | (Inherited from Object.) |
|
OnAbort | Executes the abort action. (Overrides MessageClientEntity.OnAbort().) |
|
OnBeginAcceptMessageSession | Executes upon calling the BeginAcceptMessageSession operation. |
|
OnBeginAddRule | Executes upon calling the BeginAddRule operation. |
|
OnBeginClose | Executes the begin close action. (Overrides MessageClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).) |
|
OnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object) | Executes the begin create receiver action. |
|
OnBeginCreateReceiver(String, String, ReceiveMode, TimeSpan, AsyncCallback, Object) | Executes the begin create receiver action. |
|
OnBeginOpen | Executes upon calling the operation to begin to open the message client entity. (Inherited from MessageClientEntity.) |
|
OnBeginRemoveRule | Begins removing a Rule from a Subscription through the run-time client protocol. |
|
OnClose | Executes 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. |
|
OnEndAddRule | Ends the asynchronous call to OnBeginAddRule(String, RuleDescription, TimeSpan, AsyncCallback, Object). |
|
OnEndClose | Executes the end close action. (Overrides MessageClientEntity.OnEndClose(IAsyncResult).) |
|
OnEndCreateReceiver | Executes the end create receiver action. |
|
OnEndOpen | Executes upon calling the operation to end to open the message client entity. (Inherited from MessageClientEntity.) |
|
OnEndRemoveRule | Ends the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object). |
|
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. |
|
RemoveRule | Removes the rule described by ruleName. |
|
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 subscription client SubscriptionClient mySubscriptionClient = factory.CreateSubscriptionClient(topicName, subscriptionName); // Create a receiver MessageReceiver myMessageReceiver = mySubscriptionClient.CreateReceiver(ReceiveMode.PeekLock); // Receive messages for (int count = 0; count < MsgCount; count++) { var message = subscriptionClient.Receive(); message.Complete(); }