Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Masstransit temporary queue

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?

like image 492
Oleg Avatar asked Jun 23 '26 15:06

Oleg


1 Answers

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.

like image 63
Chris Patterson Avatar answered Jun 26 '26 16:06

Chris Patterson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!