Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passive exchange and queue declaration #84

Closed
fridgebuzz opened this issue Apr 4, 2019 · 8 comments
Closed

Allow passive exchange and queue declaration #84

fridgebuzz opened this issue Apr 4, 2019 · 8 comments
Labels
effort-low type/enhancement A general enhancement
Milestone

Comments

@fridgebuzz
Copy link

It is desirable to be able to check whether a queue has been declared or not, and if not, declare it. This is due to the fact that queues can disappear for various reasons (think: some administrator deletes it; or, entire RabbitMQ cluster is restarted, but consuming app is still running; or the master for a non-mirrored durable queue is removed from the cluster, etc.)

Unfortunately, QueueSpecification does not support the "passive" flag.

AMQP.Queue.Declare.Builder contains method passive(), but Sender.declareQueue() does not use this method.

Incidentally, if there is some other way to achieve this "guaranteed declaration before each message published and/or consumed" we would love to hear it. There is one other possibility we know of, which is also prevented from working due to how it's implemented in reactor-rabbitmq but I'll file that problem separately.

@acogoluegnes acogoluegnes added effort-low type/enhancement A general enhancement labels Apr 5, 2019
@acogoluegnes acogoluegnes added this to the 1.3.0 milestone Apr 5, 2019
@acogoluegnes
Copy link
Contributor

This is certainly something that can be done. As a workaround for now, it's possible to try to re-declare the queue, with the exact same arguments. Resource declaration is idempotent in AMQP, as long as the properties of the resource are the same. Trying to re-declare an existing resource with different properties will result in an error.

@acogoluegnes acogoluegnes changed the title Allow passive queue declaration Allow passive exchange and queue declaration Apr 15, 2019
@vanseverk
Copy link
Contributor

@acogoluegnes I have a feature branch ready, can we discuss the PR on gitter?

@acogoluegnes
Copy link
Contributor

You can create the PR (or draft PR) and we can discuss there. I'll be available on Gitter on Monday. Thanks!

@acogoluegnes
Copy link
Contributor

Fixed by #88.

acogoluegnes added a commit that referenced this issue Jun 17, 2019
@acogoluegnes
Copy link
Contributor

@fridgebuzz There is now an example test that uses passive declaration before publishing messages, can you please confirm this is what you want to achieve?

@fridgebuzz
Copy link
Author

@acogoluegnes Sorry for the delay, but yes this is exactly what we wanted. Thanks very much for the prompt enhancement!

@sureshparmar042
Copy link

Hi team, can I active/ inactive exchange at runtime?

@acogoluegnes
Copy link
Contributor

@sureshparmar042 Exchanges in RabbitMQ cannot disabled, they can only be deleted and re-created. Note after deletion, all their bindings are deleted as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-low type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants