Skip to content

Commit

Permalink
Update transports/azure-service-bus/topology.md
Browse files Browse the repository at this point in the history
Co-authored-by: Poornima Nayar <[email protected]>
  • Loading branch information
lailabougria and poornimanayar authored Nov 7, 2024
1 parent c246418 commit c843f89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transports/azure-service-bus/topology.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The "single topic" design was chosen over a "topic per event type" design due to

The need to support polymorphism was the most substantial reason to implement a "single topic" design.

For simple events or no need for polymorphism, it is possible to map the contract type to the topic since the relationship is 1:1. Such topologies are mostly built without automatically forwarding messages in subscriptions to the destination queues. The subscription acts as a virtual queue. In cases when subscribers are offline or slow for some time, the quota of the topic may be reached, which can cause all publish operations to the topic to fail. Subscriptions in non-forwarding mode share the topic quota.
For simple events or when support for polymorphism is not needed, it is possible to map the contract type to the topic since the relationship is 1:1. Such topologies are mostly built without automatically forwarding messages in subscriptions to the destination queues. The subscription acts as a virtual queue. In cases when subscribers are offline or slow for some time, the quota of the topic may be reached, which can cause all publish operations to the topic to fail. Subscriptions in non-forwarding mode share the topic quota.

Enabling forwarding on the subscription, resolves the problem. The benefit of the event-per-topic approach, is that the filter rules can be the default catch-all rule expressed as `1 = 1`. Those are relatively straightforward to evaluate at runtime by the broker and do not impose high-performance impacts. The client-to-broker interaction rises in complexity as soon as polymorphism is required. The subscriber needs to be able to figure out all the possible contracts of the event and create multiple subscriptions on multiple topics based on the contracts exposed. But in some cases, the subscriber doesn't have access to the whole event contract the publisher publishes. In such cases, complex manual mapping is required to determine the publisher-subscriber relationship. Such a design imposes more coupling between the publisher and the subscriber, serving the opposite of what publish/subscribe is intended to solve.

Expand Down

0 comments on commit c843f89

Please sign in to comment.