I have my messagetypes in a shared assemby, Domain.Messages
, and I need to map messages from that assembly to different endpoints using the RebusConfigurationSection in my .config
file.
Like so:
<endpoints>
<add messages="Domain.Messages.SubNamespaceA, Domain.Messages" endpoint="SubsystemA.input" />
<add messages="Domain.Messages.SubNamespaceB, Domain.Messages" endpoint="SubsystemB.input" />
</endpoints>
That doesn't work but is it possible somehow or will I have to use an implementation of IDetermineMessageOwnership
and handle the routing there?
It is currently not possible to map by namespace - current options are either a) map an entire assembly of messages, like so:
or b) explicitly map message types individually, like so:
You can of course implement
IDetermineMessageOwnership
and do whichever funky lookup you feel like :)Another option, which I would prefer, is to structure message assemblies so that each assembly of messages belongs to only one endpoint. This way you could do this:
and then never have to worry about (those particular) endpoint mappings again...