zarusz / SlimMessageBus

Lightweight message bus interface for .NET (pub/sub and request-response) with transport plugins for popular message brokers.
Apache License 2.0
467 stars 78 forks source link

#244: Topology provision for shared ASB subscription #245

Closed EtherZa closed 5 months ago

EtherZa commented 5 months ago

Resolution to exception thrown when attempting to provision topology with Azure Service Bus when multiple consumers share a single subscription.

  1. CreateSubscriptionOptions across all consumers must be equal
  2. Rules are grouped by name. Any grouped rules that are equal are treated as a single rule. Any variation on filters sharing the same name will result in aborting the topology provision.
  3. @zarusz - I have added an additional Updated status to the TopologyCreationStatus enum to reflect success on updating a rule. Is this something that you favour, or should I stick with Created? Do you want Updated added but with a value equal to Created?
  4. An additional ServiceBusTopologySettings setting has been added - CanConsumerValidateSubscriptionFilters. The setting works as an extension to CanConsumerCreateSubscriptionFilter and CanConsumerReplaceSubscriptionFilters and allows for an extra gate to perform evaluation of the implemented subscription rules (server) and the code based subscription rules (no API calls will be made to ASB when all three are false).

Unit tests in SlimMessageBus.Host.Test have been set to run in series in order to avoid the race condition experienced with the library.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
89.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

EtherZa commented 5 months ago

@zarusz I've pushed the update and removed the WIP demarcation. It is on to you now :)

zarusz commented 5 months ago

Awesome work @EtherZa!