Export (0) Print
Expand All

Service Bus Topics

Updated: March 13, 2014

Topics extend the messaging features provided by queues with the addition of publish-subscribe capabilities.

Windows Azure Topics

A topic entity consists of a sequential message store like a queue, but it supports up to 2000 (this number is subject to vary in the future) concurrent and durable subscriptions, which relay message copies to a poll of worker processes. As depicted in the following figure, each subscription can define one or multiple rule entities.

Windows Azure Subscriptions

Each rule specifies a filter expression that is used to filter messages that pass through the subscription and a filter action that can modify message properties. In particular, the SqlFilter class allows a SQL92-like condition to be defined on message properties, as in the following examples:

  1. OrderTotal > 5000 OR ClientPriority > 2

  2. ShipDestinationCountry = ‘USA’ AND ShipDestinationState = ‘WA’

Conversely, the SqlRuleAction class can be used to modify, add or remove properties to a BrokeredMessage object using syntax similar to that used by the SET clause of an UPDATE SQL-command, as in the following examples.

  1. SET AuditRequired = 1

  2. SET Priority = 'High', Severity = 1

Each matching rule generates a separate copy of the published message, so any subscription can potentially generate more copies of the same message, one for each matching rule.

Topics, like queues, support a competing consumers scenario: in this context, a subscription can have a single consumer that receives all messages or a set of competing consumers that fetch messages on a first-come-first-served basis. Topics are a useful messaging solution for broadcasting messages to many consumers.

See Also

Community Additions

© 2014 Microsoft