A consumer is a type that you register, which has a specialized handler that handles the life cycle of your Consumer object.
A handler is just a general event handler.
You would use a handler if you need a small Action<> block to allow any action in your message. You must use the Consumer if you want to register a type that has a life cycle to allow any action in your message. Typically, you will need a Consumer because you want your container to allow dependencies for the type, rather than just having them within your handler. But handlers are great for small things or request-response scripts.
source share