What happens when I subscribe to a message using NServiceBus?

When I sign up as the recipient of a specific type of message using NServiceBus

Bus.Subscribe<MyMessage>()

What am I actually doing? I indicate that a specific method for the type of recipient will be called when a message is received? If so, in what context does this method run - in a static context or in the context of a new instance of a parent class (and if so, how does NServiceBus know which constructor to use)?

+3
source share
1 answer

", " queue @subscriber-machine ", " MyMessage ", , ". . MyMessage, . , , - , IHandleMessage <T> T , .

+8

Source: https://habr.com/ru/post/1737617/


All Articles