Closed SuheylZ closed 4 years ago
The line
.Routing(r=> r.TypeBased().Map<XMEssageHandler>(_queueName))
doesn't make sense 🙂
If you change it to
.Routing(r=> r.TypeBased().Map<XMEssage>(_queueName))
then your program should work.
What you're telling Rebus in the line above could be paraphrased like this:
Yo Rebus, when I tell you to send a message of type XMEssage, send it to "myqueue"
so how does it know that there is a handler without registering?
oh, sorry, I missed that 🙂 the normal way would be to register it in your IoC container, but the "IoC container" in your case is the built-in handler activator, so you register it like this:
activator.Register(() => new XMEssageHandler());
I have made a very simple program to use Rebus but I'm unable to get it running as it always crashes. here is my program.