Add ExternallyOwned() to RabbitMQ queues and exchanges (closes #3064)#3066
Merged
Conversation
Wolverine could already mark a Kafka topic as ExternallyOwned() (GH-3062) so that the topic is never declared at startup nor deleted on teardown. This adds the same escape hatch to the RabbitMQ transport for queues and exchanges that are owned by another system, where the connecting identity lacks the configure/delete permissions to create or remove the resource. When an endpoint is marked ExternallyOwned(): - it is never declared at startup, even with AutoProvision() on - it is never deleted during a resources teardown - its bindings are neither set up nor torn down Exposed as ExternallyOwned() on RabbitMqListenerConfiguration, RabbitMqSubscriberConfiguration, and RabbitMqExchangeConfiguration, and as an IsExternallyOwned setter on RabbitMqExchangeConfigurationExpression (alongside the existing DeclarePassive setter). Also fixes a teardown asymmetry surfaced by this work: a DeclarePassive exchange only verifies existence at startup (it never creates the exchange), so it is now left alone on teardown rather than being deleted. Adds externally_owned_rabbit_topology_is_skipped with broker-side existence checks covering queue/exchange setup-skip, owned-alongside-external, and the listener/exchange/DeclarePassive teardown paths. Documents the feature in the RabbitMQ object-management guide, including the DeclarePassive distinction. Closes #3064 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3064. Brings the
ExternallyOwned()escape hatch added for Kafka topics (#3062) to the RabbitMQ transport, for queues and exchanges owned by another system where the connecting identity lacksconfigure/deletepermissions.Behavior
When a queue or exchange is marked
ExternallyOwned(), Wolverine will:AutoProvision()enabledresources teardownAPI
ExternallyOwned()is available on:RabbitMqListenerConfiguration—opts.ListenToRabbitQueue("q").ExternallyOwned()RabbitMqSubscriberConfiguration—opts.PublishMessage<T>().ToRabbitQueue("q").ExternallyOwned()/.ToRabbitExchange("ex").ExternallyOwned()RabbitMqExchangeConfiguration…and as an
IsExternallyOwnedsetter onRabbitMqExchangeConfigurationExpression, alongside the existingDeclarePassivesetter.Included fix: DeclarePassive teardown asymmetry
A
DeclarePassiveexchange only makes a passive declaration at startup (verify-existence, never create). It was still being deleted on teardown, which is asymmetric — Wolverine would destroy a resource it deliberately never created. It is now left alone on teardown as well. (ExternallyOwnedandDeclarePassiveremain distinct flags: passive still touches the broker to verify existence; externally-owned never touches it at all.)Tests
New
externally_owned_rabbit_topology_is_skipped(6 facts, broker-side passive-declare existence checks):AutoProvision()DeclarePassiveexchange aloneAll 6 pass against the local broker; 52 related existing RabbitMQ tests stay green.
wolverine.slnx -c Releasebuilds clean (0 warnings, 0 errors).Docs
New "Externally-Owned Queues and Exchanges" section in the RabbitMQ object-management guide, including the
DeclarePassivedistinction note.🤖 Generated with Claude Code