Masstransit temporary queue

不问归期 提交于 2019-12-10 10:20:41

问题


I'm developing client application which use masstransit and rabbitmq. On application start I'm creating new queue with unique name for communication with server applications via masstransit(request/response model). On application closing I should delete this queue, but if client application crushes queue will present on rabbitmq.

Is it possible to create temporary queue via masstransit which rabbitmq will automatically delete when client disconnects from queue?


回答1:


You can create a temporary queue by using the ?temporary=true query string parameter.

With RabbitMQ, you can also dynamically create the queue name by using * as the queue name. Such as:

x.ReceiveFrom("rabbitmq://localhost/vhost/*?temporary=true");

This would create a temporary queue with a randomly generated name that is deleted when the connection is closed.



来源:https://stackoverflow.com/questions/30760108/masstransit-temporary-queue

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