Share via


ServiceBusNamespaceClient.GetTopics Method

Retrieves a collection of topics in a service namespace.

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

Syntax

'Declaration
Public Function GetTopics As IEnumerable(Of Topic)
'Usage
Dim instance As ServiceBusNamespaceClient
Dim returnValue As IEnumerable(Of Topic)

returnValue = instance.GetTopics()
public IEnumerable<Topic> GetTopics()
public:
IEnumerable<Topic^>^ GetTopics()
member GetTopics : unit -> IEnumerable<Topic> 
public function GetTopics() : IEnumerable<Topic>

Return Value

Type: System.Collections.Generic.IEnumerable<Topic>
A IEnumerable<T> enumeration of topics under the current namespace. Returns an empty collection if no topics are found.

Exceptions

Exception Condition
TimeoutException

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

UnauthorizedAccessException

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

MessagingException

An internal error or unexpected exception occurs.

See Also

Reference

ServiceBusNamespaceClient Class

Microsoft.ServiceBus Namespace