Something that was kind of confusing for me was the relationship between MassTransit Fault<T> events and Error Queues.
When a MassTransit consumer throws an exception, the exception is caught by middleware and the message is moved to an _error queue (prefixed by the receive endpoint queue name). The exception details are stored as headers with the message.
I was thinking that the Messages were wrapped in a Fault<T> event before they were stored in the queue. But it turns out that they are unrelated.
What really happens is that in addition to moving the message to an error queue, MassTransit also generates a Fault<T>
event. This event is either sent to a FaultAddress
or ResponseAddress if present or the fault is published.