View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |

Plans for Cat.Messaging

Publish and consume messages on Azure Service Bus with the same handler style as the other modules.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

Services in the application architecture talk in two ways. A direct call goes through the API gateway. A message goes over Azure Service Bus. The architecture says to prefer messages, because they keep services loosely coupled.

Today the modules have nothing for the message side. Cat.Messaging fills that gap. A service publishes a message when something important happened, like OrderPlaced. Other services subscribe and react in their own time.

The module should feel like Cat.Commands and Cat.Queries: a message is a plain type, a handler handles it, a processor finds the handler, and decorators wrap it.

What we already know

From the root readme:

From the demo plan:

From the saga plan:

From the module conventions:

Decisions and open questions

Decided

Topic Decision
Transport Azure Service Bus.
Style The same handler, processor and decorator style as the other modules.
Demo hosting The Service Bus emulator, started by the AppHost.
Aspire The module never references Aspire.
Wait step Cat.Sagas goes through the messaging abstractions, not through Cat.EventAggregators.

Open

Questions before building

  1. Is Azure Service Bus the only transport we want, now and later?
  2. Should Cat.Messaging and Cat.EventProcessor be one module with two packages, or two modules?
  3. Where do message contracts live by default, and does the module support both sharing them and copying them?
  4. Do we want an outbox and an inbox in this module, or in Cat.EFCore?
  5. How should a failed message end: retry, dead letter, or a failed ICatResponse that the handler decides on?
  6. Do we publish from a command handler, from a service request handler or from an event subscriber? Which one is the preferred way?
  7. Who creates topics and subscriptions in the demo and in production?
  8. Which Azure Service Bus SDK version and features may we rely on, such as sessions and scheduled messages?
  9. Is scheduled delivery through the bus (“deliver in 24 hours”) in scope? It overlaps with Cat.Scheduling.
  10. Should the first version ship before or together with Cat.EventProcessor?