Share via


Topic Description

 

The topic description is an XML AtomPub document that defines the desired semantics for a topic. The topic description contains the following properties. For more information, see the TopicDescription Properties topic.

Topic Description Properties

  • MaxSizeInMegaBytes: Number
    Specifies the maximum topic size in megabytes. Any attempt to enqueue a message that causes the topic to exceed this value will fail. All messages that are stored in the topic or any of its subscriptions count towards this value. Multiple copies of a message that reside in one or more subscriptions count as a single messages. For example, if message m exists once in subscription s1 and twice in subscription s2, then m is counted as a single message. You can only set this parameter when you create the topic, using the following values:

    • Range: 1 – 5*1024 MB

    • Default: 1*1024

  • SizeinBytes: Number
    Reflects the actual bytes of messages in the topic that count toward the topic quota. (read-only)

    • Range: 0 –MaxTopicSizeinMegaBytes
  • DefaultMessageTimeToLive: XML datetime
    Determines how long a message lives in the associated subscriptions. Subscriptions do not inherit the TTL value from the topic, as long as the subscription has a specified TTL. Based on whether dead-lettering is enabled, a message whose TTL has expired will either be moved to the subscription’s associated DeadLtterQueue or will be permanently deleted. You can set the following values when you create the topic:

    • Range: 1 second –TimeSpan.MaxValue

    • Default: TimeSpan.MaxValue

  • RequiresDuplicateDetection: True, False
    If enabled, the topic detects duplicate messages within the time span specified by the DuplicateDetectionHistoryTimeWindow property. Settable only at topic creation time.

    • Default: false
  • DuplicateDetectionHistoryTimeWindow
    Specifies the time span during which Service Bus will detect message duplication.

    • Range: 1 second – 7 days

    • Default: 10 minutes

  • MaximumNumberOfSubscriptions
    Specifies the maximum number of subscriptions that can be associated with the topic.

    • Range: 1– 2000

    • Default: 2000 subscriptions

  • EnableBatchedOperations
    Enables or disables service side batching behavior when performing operations for the specific queue. When enabled, Service Bus collects/batches multiple operations to the back end in order to be more connection efficient. If you want lower operation latency, you can disable this feature.

  • FilteringMessagesBeforePublishing
    Gets or sets whether messages should be filtered before publishing.

  • IsAnonymousAccessible
    Gets whether anonymous access is allowed.

  • AuthorizationRules
    Gets the authorization rules for the description.

  • Status
    Gets or sets the current status of the topic (enabled or disabled). When a topic is disabled, that topic cannot send or receive messages.

  • SupportOrdering
    Gets or sets whether the topics can be ordered.

It is important to note that the schema validation of the description during topic creation is sensitive to the order of its child elements. For example, the following is not accepted as a valid topic description.

<TopicDescription xmlns=\"https://schemas.microsoft.com/netservices/2010/10/servicebus/connect\">
<MaxSizeInMegaBytes>10000</MaxSizeInMegaBytes>
<DefaultMessageTimeToLive>PT5M</DefaultMessageTimeToLive>
<LockDuration>PT2M</LockDuration>
<RequiresGroupedReceives>False</RequiresGroupedReceives>
<SupportsDuplicateDetection>False</SupportsDuplicateDetection>
</TopicDescription>

However, if the elements appear as below, it is accepted as a valid queue description:

<TopicDescription xmlns=\"https://schemas.microsoft.com/netservices/2010/10/servicebus/connect\">
<LockDuration>PT2M</LockDuration>
<MaxSizeInMegaBytes>1024</MaxSizeInMegaBytes>
<SupportsDuplicateDetection>false</SupportsDuplicateDetection>
<RequiresGroupedReceives>false</RequiresGroupedReceives>
<DefaultMessageTimeToLive>PT5M</DefaultMessageTimeToLive>
</TopicDescription>

Here are some things you can do with this API

  • List all topics under a given path:

    http://<serviceBusAddress>/$Resources/Topics?$filter=startswith(path, ‘/my/test’)
    
  • List all topics updated in the last 5 minutes:

    http://<serviceBusAddress>/$Resources/Topics?$filter=lastModifiedTime Gt  2011-08-09T21:44:36.2481552Z
    
  • List all topics having at least one message:

    http://<serviceBusAddress>/$Resources/Topics?$filter=MessageCount Gt 0
    

See Also

Topics
Example: Creating a Topic
Create Topic
Delete Topic
Get Topic
List Topics