Export (0) Print
Expand All

SubscriptionClient Class

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

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

public abstract class SubscriptionClient extends MessageClientEntity

The SubscriptionClient type exposes the following members.

  NameDescription
Public propertyIsClosed (Inherited from ClientEntity.)
Public propertyMessagingFactoryGets the messaging factory used to create this subscription client.
Public propertyModeGets the message receive mode when processing the received message.
Public propertyNameGets the name of the subscription.
Public propertyPrefetchCountGets or sets the number of messages that the message receiver can simultaneously request.
Public propertyRetryPolicy (Inherited from ClientEntity.)
Protected propertyThisLock (Inherited from ClientEntity.)
Public propertyTopicPathGets the full pathname of the topic.
Top

  NameDescription
Public methodAbandon(Guid)Discards the message and relinquishes the message lock ownership.
Public methodAbandon(Guid, IDictionary(String, Object))Discards the message and relinquishes the message lock ownership.
Public methodAbandonAsync(Guid)Asynchronously discards the message and relinquishes the message lock ownership.
Public methodAbandonAsync(Guid, IDictionary(String, Object))Asynchronously discards the message and relinquishes the message lock ownership.
Public methodAbortPerforms abort functionality on the messaging entity. (Inherited from ClientEntity.)
Public methodAcceptMessageSession()Accepts a message session that allows grouping of related messages for processing in a single transaction.
Public methodAcceptMessageSession(String)Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier.
Public methodAcceptMessageSession(TimeSpan)Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.
Public methodAcceptMessageSession(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.
Public methodAcceptMessageSessionAsync()Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.
Public methodAcceptMessageSessionAsync(String)Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.
Public methodAcceptMessageSessionAsync(TimeSpan)Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.
Public methodAcceptMessageSessionAsync(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.
Public methodAddRule(RuleDescription)Adds a new rule to the Subscription using the specified rule description.
Public methodAddRule(String, Filter)Adds a rule to the current subscription with the specified name and filter expression.
Public methodAddRuleAsync(RuleDescription)Asynchronously adds a new rule to the Subscription using the specified rule description.
Public methodAddRuleAsync(String, Filter)Asynchronously adds a rule to the current subscription with the specified name and filter expression.
Public methodBeginAbandon(Guid, AsyncCallback, Object)Begins an asynchronous operation to abandon the message and relinquish its lock.
Public methodBeginAbandon(Guid, IDictionary(String, Object), AsyncCallback, Object)Begins an asynchronous operation to abandon the message and relinquish its lock.
Public methodBeginAcceptMessageSession(AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(String, AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(String, TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAddRule(RuleDescription, AsyncCallback, Object)Begins an asynchronous operation to add a new rule to the subscription.
Public methodBeginAddRule(String, Filter, AsyncCallback, Object)Begins an asynchronous operation to add a new rule to the subscription.
Public methodBeginCloseBegins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodBeginCompleteBegins an asynchronous operation to complete processing of a message.
Public methodBeginCompleteBatchBegins an asynchronous operation to complete processing of a message.
Public methodBeginDeadLetter(Guid, AsyncCallback, Object)Begins an asynchronous operation to move a message to the dead letter queue.
Public methodBeginDeadLetter(Guid, IDictionary(String, Object), AsyncCallback, Object)Begins an asynchronous operation to move a message to the dead letter queue.
Public methodBeginDeadLetter(Guid, String, String, AsyncCallback, Object)Begins an asynchronous operation to move a message to the dead letter queue.
Public methodBeginDefer(Guid, AsyncCallback, Object)Begins an asynchronous operation to suspend processing of a message.
Public methodBeginDefer(Guid, IDictionary(String, Object), AsyncCallback, Object)Begins an asynchronous operation to suspend processing of a message.
Public methodBeginGetMessageSessions(AsyncCallback, Object)Begins an asynchronous operation to get a message session.
Public methodBeginGetMessageSessions(DateTime, AsyncCallback, Object)Begins an asynchronous operation to get a message session.
Public methodBeginPeek(AsyncCallback, Object)Begins an asynchronous operation to return without removing the first message in the queue.
Public methodBeginPeek(Int64, AsyncCallback, Object)Begins an asynchronous operation to return without removing the first message in the queue.
Public methodBeginPeekBatch(Int32, AsyncCallback, Object)Begins an asynchronous operation to peek a batch.
Public methodBeginPeekBatch(Int64, Int32, AsyncCallback, Object)Begins an asynchronous operation to peek a batch.
Public methodBeginReceive(AsyncCallback, Object)Begins an asynchronous operation to receive a message.
Public methodBeginReceive(Int64, AsyncCallback, Object)Begins an asynchronous operation to receive a message.
Public methodBeginReceive(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to receive a message.
Public methodBeginReceiveBatch(IEnumerable(Int64), AsyncCallback, Object)Begins an asynchronous operation to receive a batch.
Public methodBeginReceiveBatch(Int32, AsyncCallback, Object)Begins an asynchronous operation to receive a batch.
Public methodBeginReceiveBatch(Int32, TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to receive a batch.
Public methodBeginRemoveRuleBegins an asynchronous remove rule action.
Public methodCloseSends a cleanup message to Service Bus to signal the completion of the usage of an entity. (Inherited from ClientEntity.)
Public methodCloseAsyncSends a cleanup message asynchronously to Service Bus to signal the completion of the usage of an entity. (Inherited from ClientEntity.)
Public methodCompleteCompletes processing of a message.
Public methodCompleteAsyncAsynchronously completes processing of a message.
Public methodCompleteBatchCompletes processing of a batch.
Public methodCompleteBatchAsyncAsynchronously completes processing of a batch.
Public methodStatic memberCreate(String, String)Creates a new copy of SubscriptionClient with specified name and topic path.
Public methodStatic memberCreate(String, String, ReceiveMode)Creates a new copy of SubscriptionClient with specified name, topic path and mode.
Public methodStatic memberCreateFromConnectionString(String, String, String)Creates a new copy of SubscriptionClient from a connection string with specified topic path and name.
Public methodStatic memberCreateFromConnectionString(String, String, String, ReceiveMode)Creates a new copy of SubscriptionClient from a connection string with specified topic path, name and mode.
Public methodDeadLetter(Guid)Moves the undelivered message to the dead letter queue.
Public methodDeadLetter(Guid, IDictionary(String, Object))Moves the undelivered message to the dead letter queue.
Public methodDeadLetter(Guid, String, String)Moves the undelivered message to the dead letter queue.
Public methodDeadLetterAsync(Guid)Asynchronously moves the undelivered message to the dead letter queue.
Public methodDeadLetterAsync(Guid, IDictionary(String, Object))Asynchronously moves the undelivered message to the dead letter queue.
Public methodDeadLetterAsync(Guid, String, String)Asynchronously moves the undelivered message to the dead letter queue.
Public methodDefer(Guid)Suspends the processing of a message.
Public methodDefer(Guid, IDictionary(String, Object))Suspends the processing of a message.
Public methodDeferAsync(Guid)Asynchronously suspends the processing of a message.
Public methodDeferAsync(Guid, IDictionary(String, Object))Asynchronously suspends the processing of a message.
Public methodEndAbandonFinishes an asynchronous operation to abandon the message and relinquish its lock.
Public methodEndAcceptMessageSessionFinishes an asynchronous operation to accept a message session that allows grouping of related messages for processing in a single transaction.
Public methodEndAddRuleEnds an asynchronous add rule operation.
Public methodEndCloseFinishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodEndCompleteFinishes an asynchronous operation to complete processing of a message.
Public methodEndCompleteBatchFinishes an asynchronous operation to complete processing of a batch.
Public methodEndDeadLetterFinishes an asynchronous operation to move message to the dead letter queue.
Public methodEndDeferFinishes an asynchronous operation to suspend processing of a message.
Public methodEndGetMessageSessionsFinishes an asynchronous operation to get the processing of a message.
Public methodEndPeekFinishes an asynchronous peek operation.
Public methodEndPeekBatchFinishes an asynchronous peek operation on a batch of messages.
Public methodEndReceiveFinishes an asynchronous operation to receive a message.
Public methodEndReceiveBatchFinishes an asynchronous operation to receive a batch.
Public methodEndRemoveRuleEnds an asynchronous remove rule operation.
Public methodEquals (Inherited from Object.)
Protected methodFaultFor internal use only. Do not inherit from this class. (Inherited from ClientEntity.)
Protected methodFinalize (Inherited from Object.)
Public methodStatic memberFormatDeadLetterPathBuilds a format name deadletter path using the specified topic path and subscription name.
Public methodStatic memberFormatSubscriptionPathBuilds a format name subscription path using the specified topic path and subscription name.
Public methodGetHashCode (Inherited from Object.)
Public methodGetMessageSessions()Gets a message session that allows grouping of related messages for processing in a single transaction.
Public methodGetMessageSessions(DateTime)Retrieves all message sessions whose session state was updated since lastUpdatedTime.
Public methodGetMessageSessionsAsync()Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction.
Public methodGetMessageSessionsAsync(DateTime)Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction.
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnAbortExecutes the abort action. (Overrides ClientEntity.OnAbort().)
Protected methodOnBeginAcceptMessageSessionExecutes upon calling the BeginAcceptMessageSession operation.
Protected methodOnBeginAddRuleExecutes upon calling the BeginAddRule operation.
Protected methodOnBeginCloseExecutes the begin close action. (Overrides ClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).)
Protected methodOnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object)Executes the begin create receiver action.
Protected methodOnBeginCreateReceiver(String, String, ReceiveMode, TimeSpan, AsyncCallback, Object)Executes the begin create receiver action.
Protected methodOnBeginGetMessageSessionsExecutes upon calling the BeginGetMessageSessions operation.
Protected methodOnBeginOpen (Inherited from ClientEntity.)
Protected methodOnBeginRemoveRuleBegins removing a Rule from a Subscription through the run-time client protocol.
Protected methodOnBeginRemoveRulesByTagBegins removing a Rule from a Subscription through the run-time client protocol using a tag.
Protected methodOnCloseExecutes the close action. (Overrides ClientEntity.OnClose(TimeSpan).)
Protected methodOnClosed (Inherited from ClientEntity.)
Protected methodOnEndAcceptMessageSessionExecutes upon calling the EndAcceptMessageSession operation.
Protected methodOnEndAddRuleEnds the asynchronous call to OnBeginAddRule.
Protected methodOnEndCloseExecutes the end close action. (Overrides ClientEntity.OnEndClose(IAsyncResult).)
Protected methodOnEndCreateReceiverExecutes the end create receiver action.
Protected methodOnEndGetMessageSessionsExecutes the end get message action.
Protected methodOnEndOpen (Inherited from ClientEntity.)
Protected methodOnEndRemoveRuleEnds the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).
Protected methodOnEndRemoveRulesEnds the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).
Protected methodOnFaulted (Inherited from ClientEntity.)
Public methodOnMessage(Action(BrokeredMessage))Processes a message in an event-driven message pump.
Public methodOnMessage(Action(BrokeredMessage), OnMessageOptions)Processes a message in an event-driven message pump, with the given set of OnMessageOptions options.
Public methodOnMessageAsync(Func(BrokeredMessage, Task))Asynchronously processes a message.
Public methodOnMessageAsync(Func(BrokeredMessage, Task), OnMessageOptions)Asynchronously processes a message.
Protected methodOnOpen (Inherited from ClientEntity.)
Protected methodOnOpened (Inherited from ClientEntity.)
Public methodPeek()Returns without removing the first message in the queue.
Public methodPeek(Int64)Returns without removing the first message in the queue.
Public methodPeekAsync()Asynchronously returns without removing the first message in the queue.
Public methodPeekAsync(Int64)Asynchronously returns without removing the first message in the queue.
Public methodPeekBatch(Int32)Returns without removing the first messages in a batch.
Public methodPeekBatch(Int64, Int32)Returns without removing the first messages in a batch.
Public methodPeekBatchAsync(Int32)Asynchronously returns without removing the first messages in a batch.
Public methodPeekBatchAsync(Int64, Int32)Asynchronously returns without removing the first messages in a batch.
Public methodReceive()Receives a message using the InternalReceiver().
Public methodReceive(Int64)Receives a message using the InternalReceiver().
Public methodReceive(TimeSpan)Receives a message using the InternalReceiver().
Public methodReceiveAsync()Asynchronously receives a message using the InternalReceiver().
Public methodReceiveAsync(Int64)Asynchronously receives a message using the InternalReceiver().
Public methodReceiveAsync(TimeSpan)Asynchronously receives a message using the InternalReceiver().
Public methodReceiveBatch(IEnumerable(Int64))Receives a batch after the asynchronous operation.
Public methodReceiveBatch(Int32)Receives a batch after the asynchronous operation.
Public methodReceiveBatch(Int32, TimeSpan)Receives a batch after the asynchronous operation.
Public methodReceiveBatchAsync(IEnumerable(Int64))Asynchronously receives a set of messages (for batch processing).
Public methodReceiveBatchAsync(Int32)Asynchronously receives a set of messages (for batch processing).
Public methodReceiveBatchAsync(Int32, TimeSpan)Asynchronously receives a set of messages (for batch processing).
Public methodRegisterSessionHandler(Type)Registers the handler for the client session.
Public methodRegisterSessionHandler(Type, SessionHandlerOptions)Registers the handler for the client session.
Public methodRegisterSessionHandlerAsync(Type)Asynchronously registers the handler for the client session.
Public methodRegisterSessionHandlerAsync(Type, SessionHandlerOptions)Asynchronously registers the handler for the client session.
Public methodRegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)Registers the handler factory for the client session.
Public methodRegisterSessionHandlerFactory(IMessageSessionHandlerFactory, SessionHandlerOptions)Registers the handler factory for the client session.
Public methodRegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)Asynchronously registers the handler factory for the client session.
Public methodRegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory, SessionHandlerOptions)Asynchronously registers the handler factory for the client session.
Public methodRemoveRuleRemoves the rule described by ruleName.
Public methodRemoveRuleAsyncAsynchronously removes the rule described by ruleName.
Protected methodThrowIfClosed (Inherited from ClientEntity.)
Protected methodThrowIfDisposed (Inherited from ClientEntity.)
Protected methodThrowIfDisposedOrImmutable (Inherited from ClientEntity.)
Protected methodThrowIfDisposedOrNotOpen (Inherited from ClientEntity.)
Protected methodThrowIfFaulted (Inherited from ClientEntity.)
Public methodToString (Inherited from Object.)
Top

This abstract class is not meant to be inherited, so protected members of this class should be ignored.

// 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();
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Instance members are also guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft