I'm starting to use Mass Transit and I have one question. I'm using clean architecture with a mediator pattern. My project's structure is as follows:
I would like to add Mass Transit, so I've added the following projects:
My question is: should I write the logic in the consumers, or should I put it in the application's handlers? What is your opinion on this?
Thank you.
The easiest and most direct answer is "Treat consumers like you treat your controllers/handlers." So, if you don't put business logic in your controllers, don't put it in your consumers. If you do, put that logic in your controllers, then it would make sense to also put it in your consumers.
In general, I find this advice will fit with any interpretation of clean architecture.