how can I purge a MassTransit queue?

一笑奈何 提交于 2020-01-03 17:34:44

问题


I'd like to delete all the messages from a queue in my integration test SetUp routine, how can I accomplish that? No luck with googling/intellisense-bruteforce.

If it matters -- I'm using RabbitMq as transport.


回答1:


There's no way to "delete" from queues within MassTransit. For tests you can use temporary, random queue URIs via rabbitmq://localhost/*?temporary=true. Or you can just append ?temporary=true to the end of your existing queue URIs to have MT clean stuff up afterward. Note: Current, as of 2.8, temporary exchanges aren't cleaned up. This should be fixed by the next release.



来源:https://stackoverflow.com/questions/18179296/how-can-i-purge-a-masstransit-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!