简体   繁体   中英

MassTransit/RabbitMQ How to get messages in the skipped queue and log this?

I am making an application in .NET6 in combination with MassTransit and RabbitMQ. Now I want to send messages to the skipped queue so that I can log it with Serilog.

I think I need to create a skipped queue consumer zo I can receive the messages. But I don't know how to send messages to the skipped queue so I can test it.

I already have a publisher and a consumer. But don't know how to send messages that are skipped.

Messages are moved to the _skipped queue due to developer/configuration errors, typically because the message type(s) are not consumed by the consumers on the receive endpoint connected to the original queue.

RabbitMQ has shovels which can be used to move those messages back into the original queue, there is no need to write a consumer for it since you'd likely end up with a _skipped_skipped queue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM