Share via


NamespaceManager.GetTopics Method

Definition

Overloads

GetTopics()

Retrieves a collection of topics in a service namespace.

GetTopics(String)

Retrieves a collection of topics in a service namespace with the specified filter. You can filter by a combination of entity name (including starts with), entity length (Gt or Lt), created, updated, and accessed time (Gt or Lt).

GetTopics()

Retrieves a collection of topics in a service namespace.

public System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.TopicDescription> GetTopics ();
member this.GetTopics : unit -> seq<Microsoft.ServiceBus.Messaging.TopicDescription>
Public Function GetTopics () As IEnumerable(Of TopicDescription)

Returns

An IEnumerable<T> object that represents the collection of topics under the current namespace, or returns an empty collection if no topic exists.

Exceptions

The operation times out. The timeout period is initialized through the NamespaceManagerSettings class. You may need to increase the value of the OperationTimeout property to avoid this exception if the timeout value is relatively low.

The NamespaceManager object does not have sufficient permission to perform this operation. You should check to ensure that your NamespaceManager has the correct TokenProvider credentials to perform this operation.

An internal error or unexpected exception occurs.

Applies to

GetTopics(String)

Retrieves a collection of topics in a service namespace with the specified filter. You can filter by a combination of entity name (including starts with), entity length (Gt or Lt), created, updated, and accessed time (Gt or Lt).

public System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.TopicDescription> GetTopics (string filter);
member this.GetTopics : string -> seq<Microsoft.ServiceBus.Messaging.TopicDescription>
Public Function GetTopics (filter As String) As IEnumerable(Of TopicDescription)

Parameters

filter
String

The string used to filter the topics to be retrieved.

Returns

An IEnumerable<T> object that represents the collection of topics under the current namespace, or returns an empty collection if no topic exists.

Examples

var topicsWithMessages = namespaceManager.GetTopics("messageCount Gt 0");
var topicsStartsWith = namespaceManager.GetTopics($"startswith(path, 'topic') eq true");

Remarks

Filter expression formats: {Propery} {Logical Operator} {Value} AND {Filter expression} {Function} {Logical Operator} {Value} AND {Filter expression} ----------------------------------------------------------------------------------------- Available properties: Path | ModifiedAt | AccessedAt | CreatedAt | MessageCount Logical operators: Eq | Ne | Gt | Ge | Lt | Le Value: A value of the corresponding property type Functions: startswith({Propery}, {Value})

Applies to