问题
I am using Mastransit 3.5.0 with RabbitMq. If queue consumers throws exception, its is handled by default MoveExceptionToTransportFilter and moved to _error queue. For _error queue I have seperate consumer: Consume(ConsumeContext> context)
Behavior of Fault is rather different. Part of errors are handled and removed from _error queue, but part of error message still remain in error queue and do not consumed by this consumer. As I understand If I have Fault consumer then _error queue should be empty.
I can not find explanation, why errors are still in queue. Maybe because these faults were once consumed, but I cant find any indication in the headers or else where?
回答1:
This is not correct.
You should not consume from the error queue. Error queue accumulates messages that crashed their consumers, for diagnostics purposes.
Faut<T>messages are published in addition to moving messages to the error queue. These two things are unrelated.If you have a consumer of
FaultorFault<T>events, you just do that - consume these events. It has nothing to do with messages in the error queue.
来源:https://stackoverflow.com/questions/46128546/masstransit-error-queue-is-consuming-but-still-is-not-empty