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.EventProcessor

Worker support that turns incoming messages into service requests.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

Not all work comes in over HTTP. A message on Azure Service Bus is work that starts on its own. The service project structure has a place for it: the optional ServiceName.EventProcessor project.

Cat.EventProcessor is the code behind that project. It listens to the bus. Every incoming message becomes a service request that the core handles. The worker holds no business logic.

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
Hosting A worker that runs inside the API of the service.
Work One incoming message becomes one service request.
Business logic None in the worker.
Testing A development endpoint simulates a message, in debug mode only.

Open

Questions before building

  1. Do we build this together with Cat.Messaging or after it?
  2. How should a message find its service request: by convention, by registration or by attribute?
  3. What should a failed response do to the message? Is “retry a few times, then dead letter” a good default?
  4. Do we want built-in duplicate detection, or do we tell handlers to be idempotent?
  5. Who is the current user when a message starts the work?
  6. Should one service be able to run more than one listener, for example for different topics?
  7. Is a competing consumer setup (several instances of the same service) a given? That affects ordering.
  8. What does the development endpoint look like? A generic one for any message type, or one per message?
  9. Does the module need a way to pause or stop a listener at runtime?
  10. Which parts of the saga dispatcher (find, lock, resume, save) belong here and which in Cat.Sagas?