SALES: 1-800-867-1380
0 out of 2 rated this helpful - Rate this topic

SubscriptionClient Class

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

System.Object
  Microsoft.ServiceBus.Messaging.MessageClientEntity
    Microsoft.ServiceBus.Messaging.SubscriptionClient

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 propertyIsClosedGets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.)
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 propertyRetryPolicyGets or sets a retry policy associated with this instance that determines whether if the request should be retried. (Inherited from MessageClientEntity.)
Protected propertyThisLockGents an object used for locking the MessageClientEntity instance. (Inherited from MessageClientEntity.)
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 methodAbortAborts the message client entity and puts its status into a closing state. (Inherited from MessageClientEntity.)
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 methodCloseCloses the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.)
Public methodCloseAsyncAsynchronously closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.)
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 methodFaultPuts the message client entity into a faulted state. (Inherited from MessageClientEntity.)
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 MessageClientEntity.OnAbort().)
Protected methodOnBeginAcceptMessageSessionExecutes upon calling the BeginAcceptMessageSession operation.
Protected methodOnBeginAddRuleExecutes upon calling the BeginAddRule operation.
Protected methodOnBeginCloseExecutes the begin close action. (Overrides MessageClientEntity.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 methodOnBeginOpenExecutes upon calling the operation to begin to open the message client entity. (Inherited from MessageClientEntity.)
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 MessageClientEntity.OnClose(TimeSpan).)
Protected methodOnClosedOccurs when the message client entity is transitioned into a closing state. (Inherited from MessageClientEntity.)
Protected methodOnEndAcceptMessageSessionExecutes upon calling the EndAcceptMessageSession operation.
Protected methodOnEndAddRuleEnds the asynchronous call to OnBeginAddRule.
Protected methodOnEndCloseExecutes the end close action. (Overrides MessageClientEntity.OnEndClose(IAsyncResult).)
Protected methodOnEndCreateReceiverExecutes the end create receiver action.
Protected methodOnEndGetMessageSessionsExecutes the end get message action.
Protected methodOnEndOpenExecutes upon calling the operation to end to open the message client entity. (Inherited from MessageClientEntity.)
Protected methodOnEndRemoveRuleEnds the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).
Protected methodOnEndRemoveRulesEnds the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).
Protected methodOnFaultedExecutes upon calling the Fault operation. (Inherited from MessageClientEntity.)
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 methodOnOpenExecutes upon calling the operation to open the message client entity. (Inherited from MessageClientEntity.)
Protected methodOnOpenedExecutes when the message client entity is opened. (Inherited from MessageClientEntity.)
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 methodThrowIfClosedThrows an exception if the message client entity is closed. (Inherited from MessageClientEntity.)
Protected methodThrowIfDisposedThrows an exception if the message client entity is disposed. (Inherited from MessageClientEntity.)
Protected methodThrowIfDisposedOrImmutableThrows an exception if the client is disposed or immutable. (Inherited from MessageClientEntity.)
Protected methodThrowIfDisposedOrNotOpenThrows an exception if the client is disposed or not open. (Inherited from MessageClientEntity.)
Protected methodThrowIfFaultedThrows an exception if the client is faulted. (Inherited from MessageClientEntity.)
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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.