onebeyond / rascal

A config driven wrapper for amqp.node supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption and channel pooling.
MIT License
451 stars 69 forks source link

Deleting queues and subscription on demand #189

Closed SaiKrishnaMaddu closed 2 years ago

SaiKrishnaMaddu commented 2 years ago

can we delete the queues and subscriptions on demand as in we need to delete queues from the rabbitMQ console permanently

cressie176 commented 2 years ago

Hi @SaiKrishnaMaddu,

You can obtain a raw connecting using the vhost.connect function, then using the underlying amqplib api. It's not really what Rascal was intended for though, since Rascal is config driven, so any queues you define in config will be recreated the next time the application is restarted (depending on your configuration).

An alternative would be to call broker.nuke which will destroy everything Rascal has created, but this was only intended to be called for local test environments.

SaiKrishnaMaddu commented 2 years ago

@cressie176 Thank you for responding

we don't want to restart the application (nodeJS App), but we want to delete add and delete the queues on demand, are you suggesting to recreate the broker again by removing the unwanted queues and subscriptions from rascalConfig?

cressie176 commented 2 years ago

Hi @SaiKrishnaMaddu

we want to delete add and delete the queues on demand

Rascal isn't appropriate for this use case. It's config driven, so queues and exchanges are intended to be created on initialisation. Your best option is to use amqplib directly instead of Rascal.