SubscriptionClient Class

Definition

Represents the anchor class used in run-time operations related to a topic subscription.

public abstract class SubscriptionClient : Microsoft.ServiceBus.Messaging.MessagingEntityClient
type SubscriptionClient = class
    inherit MessagingEntityClient
Public MustInherit Class SubscriptionClient
Inherits MessagingEntityClient
Inheritance

Examples

// Create subscription client
SubscriptionClient mySubscriptionClient = 
factory.CreateSubscriptionClient(mySubscription);

// Receive messages
for (int count = 0; count < MsgCount; count++)
{
    var message = mySubscriptionClient.Receive();
    message.Complete();
}

Properties

IsClosed (Inherited from ClientEntity)
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.

Path

Gets the queue's, topic's, or subscription's path relative to the MessagingFactory base address.

(Inherited from MessagingEntityClient)
PrefetchCount

Gets or sets the number of messages that the message receiver can simultaneously request.

RetryPolicy (Inherited from ClientEntity)
ThisLock (Inherited from ClientEntity)
TopicPath

Gets the full pathname of the topic.

Methods

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()

Performs abort functionality on the messaging entity.

(Inherited from ClientEntity)
AcceptMessageSession()

Accepts a message session that allows grouping of related messages for processing in a single transaction.

AcceptMessageSession(Boolean)
AcceptMessageSession(Boolean, TimeSpan)
AcceptMessageSession(String)

Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier.

AcceptMessageSession(String, Boolean)
AcceptMessageSession(String, Boolean, TimeSpan)
AcceptMessageSession(String, Guid)
AcceptMessageSession(String, Guid, TimeSpan)
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.

AcceptMessageSession(TimeSpan)

Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

AcceptMessageSessionAsync()

Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

AcceptMessageSessionAsync(Boolean)
AcceptMessageSessionAsync(Boolean, TimeSpan)
AcceptMessageSessionAsync(String)

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, Boolean)
AcceptMessageSessionAsync(String, Boolean, TimeSpan)
AcceptMessageSessionAsync(String, Guid)
AcceptMessageSessionAsync(String, Guid, TimeSpan)
AcceptMessageSessionAsync(String, 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(TimeSpan)

Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

AddRule(RuleDescription)

Adds a new rule to the SubscriptionDescription using the specified rule description.

AddRule(String, Filter)

Adds a rule to the current subscription with the specified name and filter expression.

AddRuleAsync(RuleDescription)

Asynchronously adds a new rule to the SubscriptionDescription using the specified rule description.

AddRuleAsync(String, Filter)

Asynchronously adds a rule to the current subscription with the specified name and filter expression.

Close()

Sends a cleanup message to Service Bus to signal the completion of the usage of an entity.

(Inherited from ClientEntity)
CloseAsync()

Sends a cleanup message asynchronously to Service Bus to signal the completion of the usage of an entity.

(Inherited from ClientEntity)
Complete(Guid)

Completes processing of a message.

CompleteAsync(Guid)

Asynchronously completes processing of a message.

CompleteBatch(IEnumerable<Guid>)

Completes processing of a batch.

CompleteBatchAsync(IEnumerable<Guid>)

Asynchronously completes processing of a batch.

Create(String, String)

Creates a new copy of SubscriptionClient with specified name and topic path.

Create(String, String, ReceiveMode)

Creates a new copy of SubscriptionClient with specified name, topic path and mode.

CreateFromConnectionString(String, String, String)

Creates a new copy of SubscriptionClient from a connection string with specified topic path and name.

CreateFromConnectionString(String, String, String, ReceiveMode)

Creates a new copy of SubscriptionClient from a connection string with specified topic path, name and mode.

CreateWithAzureActiveDirectory(Uri, String, String, AzureActiveDirectoryTokenProvider+AuthenticationCallback, String, ReceiveMode, Nullable<TimeSpan>, TransportType)

Creates a new instance of the SubscriptionClient by using authentication callback .

CreateWithManagedIdentity(Uri, String, String, ReceiveMode, Nullable<TimeSpan>, TransportType)

Creates a new instance of the SubscriptionClient by using Azure Managed Identity authentication.

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.

Fault()

For internal use only. Do not inherit from this class.

(Inherited from ClientEntity)
FormatDeadLetterPath(String, String)

Builds a format name deadletter path using the specified topic path and subscription name.

FormatSubscriptionPath(String, String)

Builds a format name subscription path using the specified topic path and subscription name.

GetMessageSessions()

Gets a message session that allows grouping of related messages for processing in a single transaction.

GetMessageSessions(DateTime)

Retrieves all message sessions whose session state was updated since lastUpdatedTime.

GetMessageSessionsAsync()

Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction.

GetMessageSessionsAsync(DateTime)

Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction.

OnAbort()

Executes the abort action.

OnBeginAcceptMessageSession(String, ReceiveMode, Boolean, Nullable<Guid>, TimeSpan, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginAcceptMessageSession operation.

OnBeginAddRule(RuleDescription, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginAddRule operation.

OnBeginClose(TimeSpan, AsyncCallback, Object)

Executes the begin close action.

OnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object)

Executes the begin create receiver action.

OnBeginCreateReceiver(String, String, ReceiveMode, TimeSpan, AsyncCallback, Object)

Executes the begin create receiver action.

OnBeginGetMessageSessions(DateTime, AsyncCallback, Object)

Executes upon calling the BeginGetMessageSessions operation.

OnBeginGetRules(Int32, Int32, TimeSpan, AsyncCallback, Object)
OnBeginOpen(TimeSpan, AsyncCallback, Object) (Inherited from ClientEntity)
OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object)

Begins removing a RuleDescription from a SubscriptionDescription through the run-time client protocol.

OnBeginRemoveRulesByTag(String, TimeSpan, AsyncCallback, Object)

Begins removing a RuleDescription from a SubscriptionDescription through the run-time client protocol using a tag.

OnClose(TimeSpan)

Executes the close action.

OnClosed() (Inherited from ClientEntity)
OnEndAcceptMessageSession(IAsyncResult)

Executes upon calling the EndAcceptMessageSession operation.

OnEndAddRule(IAsyncResult)

Ends the asynchronous call to OnBeginAddRule(RuleDescription, TimeSpan, AsyncCallback, Object).

OnEndClose(IAsyncResult)

Executes the end close action.

OnEndCreateReceiver(IAsyncResult)

Executes the end create receiver action.

OnEndGetMessageSessions(IAsyncResult)

Executes the end get message action.

OnEndGetRules(IAsyncResult)
OnEndOpen(IAsyncResult) (Inherited from ClientEntity)
OnEndRemoveRule(IAsyncResult)

Ends the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).

OnEndRemoveRules(IAsyncResult)

Ends the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).

OnFaulted() (Inherited from ClientEntity)
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(TimeSpan) (Inherited from ClientEntity)
OnOpened() (Inherited from ClientEntity)
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)

Returns without removing the first messages in a batch.

PeekBatch(Int64, Int32)

Returns without removing the first messages in a batch.

PeekBatchAsync(Int32)

Asynchronously returns without removing the first messages in a batch.

PeekBatchAsync(Int64, Int32)

Asynchronously returns without removing the first messages in a batch.

Receive()

Receives a message using the Microsoft.ServiceBus.Messaging.SubscriptionClient.InternalReceiver.

Receive(Int64)

Receives a deferred message using the Microsoft.ServiceBus.Messaging.SubscriptionClient.InternalReceiver. This method only works for deferred message, not regular one.

Receive(TimeSpan)

Receives a message using the Microsoft.ServiceBus.Messaging.SubscriptionClient.InternalReceiver.

ReceiveAsync()

Asynchronously receives a message using the Microsoft.ServiceBus.Messaging.SubscriptionClient.InternalReceiver.

ReceiveAsync(Int64)

Asynchronously receives a message using the Microsoft.ServiceBus.Messaging.SubscriptionClient.InternalReceiver. This method only works for deferred message, not regular one.

ReceiveAsync(TimeSpan)

Asynchronously receives a message using the Microsoft.ServiceBus.Messaging.SubscriptionClient.InternalReceiver.

ReceiveBatch(IEnumerable<Int64>)

Receives a batch after the asynchronous operation.

ReceiveBatch(Int32)

Receives a batch after the asynchronous operation.

ReceiveBatch(Int32, TimeSpan)

Receives a batch after the asynchronous operation.

ReceiveBatchAsync(IEnumerable<Int64>)

Asynchronously receives a set of messages (for batch processing).

ReceiveBatchAsync(Int32)

Asynchronously receives a set of messages (for batch processing).

ReceiveBatchAsync(Int32, TimeSpan)

Asynchronously receives a set of messages (for batch processing).

RegisterSessionHandler(Type)

Registers the handler for the client session.

RegisterSessionHandler(Type, SessionHandlerOptions)

Registers the handler for the client session.

RegisterSessionHandlerAsync(Type)

Asynchronously registers the handler for the client session.

RegisterSessionHandlerAsync(Type, SessionHandlerOptions)

Asynchronously registers the handler for the client session.

RegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)

Registers the handler factory for the client session.

RegisterSessionHandlerFactory(IMessageSessionHandlerFactory, SessionHandlerOptions)

Registers the handler factory for the client session.

RegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)

Asynchronously registers the handler factory for the client session.

RegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory, SessionHandlerOptions)

Asynchronously registers the handler factory for the client session.

RemoveRule(String)

Removes the rule described by ruleName.

RemoveRuleAsync(String)

Asynchronously removes the rule described by ruleName.

RenewMessageLock(Guid)
RenewMessageLockAsync(Guid)
ThrowIfClosed() (Inherited from ClientEntity)
ThrowIfDisposed() (Inherited from ClientEntity)
ThrowIfDisposedOrImmutable() (Inherited from ClientEntity)
ThrowIfDisposedOrNotOpen() (Inherited from ClientEntity)
ThrowIfFaulted() (Inherited from ClientEntity)

Applies to