开发者

How to handle only specific messages using NServiceBus Host

I have a seperate class library of messages. Each handler implementing IHandleMessages. I also have a seperate class library that uses the NServiceBus.Host to act as a message handling service. I know I can handle the ordering of messages but can I say w开发者_Go百科hich message handlers I want the host to handle? At the minute it seems that any reference to IHandleMessage will be handled by the host


You can custom initialize your endpoint and use the With(IEnumerable<Type> typesToScan) overload. You will need to include the NSB types as well. I would recommend splitting up the assembly into multiple assemblies and then use the With(IEnumberable assemblies) overload to simplify the process. You could still deploy all handlers, but just configure endpoints to use a specific set.


Why not just have one handler per NServiceBus host? Makes it nice and easy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜