Skip to content

How to cqrs with message bus

twitter logo github logo ・1 min read  

Hey, I try to create an application with the cqrs pattern in. Net. So I use mediatr as command and query invoker.

This works very well for now. But I think that is to right coupled Between the Modules. Because I have one base application that serve some webapi Controllers and using nuget (satelite) pakages that contains the desired command and query Object and also the handler. These package will be tested independently.

So my idea was to use any Bus system(asb, rabbitmq..) for "sending" messages (command and queries) between the Module.

Is there any kind of good toolkit / Pattern /Way for this?

Or are I am on a wrong path for this and do a wrong descision?

twitter logo DISCUSS (4)
markdown guide

CQRS isn't architecture, its just another hammer to hit nails with. At the most basic level, you are just separating writes from reads.


Yep I know that. So where and how the command and queries will distributed doesn't matter? That comes to the point if there is a good toolkit like mediatr that Support a message Bus as message Transport. Or must I build it really on my own?


MediatR is mostly an in-memory bus. If your reads and writes are in physically separate solutions. You could use NServiceBus over AzureServiceBus to publish and subscribe to messages.

I would just start with one solution with separate projects for reads and writes, use mediatR as your bus, then refactor when needed.

Nice thx that points me in the right dirction. I think this can be become very complex. Thx alot for your Suggestion πŸ‘

Classic DEV Post from Dec 7 '18

10 Great Web Development Learning Project Ideas

The best way to learn web development is to find a project that will push you f...

Der Sascha profile image