Conversation
…t binding Under BindExplicitly(), a send addressed by rabbitmq:q/<name> failed with "Queue not found" unless the queue was declared in the sending host's topology. The dispatch endpoint now resolves its target by name: a queue or exchange that is part of the topology is provisioned per its auto-provision setting, any other target is published to by name and never declared, bound, or consumed. TryGetDispatchEndpoint matches candidates by queue or exchange name, and the topology address parser moved to UriHelpers so both call sites share it.
Static readonly fields in the Postgres examples lacked the s_ prefix and a Demo.Shipping handler kept an unused assignment, which fails any build that includes the example projects.
This branch has not been deployed
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.
Summary
Under
BindExplicitly(), a send addressed by URI,bus.SendAsync(message, new SendOptions { Endpoint = new Uri("rabbitmq:q/<name>") }), failed withInvalidOperationException("Queue not found")unless<name>was declared in the sending host's own topology. The routing strategy created a dispatch endpoint configuration from the address, butRabbitMQDispatchEndpoint.OnCompleterequired the queue to be a topology resource, and in explicit mode the address-created endpoint does not add one. The only workaround was to declare every foreign queue locally withDeclareQueue(name).AutoProvision(false).A point-to-point send to a queue another service owns has no topology-ownership implication: the sender never declares, binds, or consumes the queue.
Change
RabbitMQDispatchEndpointresolves its target by name. A queue or exchange that is part of the topology is provisioned according to its auto-provision setting, as before. Any other target is published to by name, to the default exchange with the queue name as routing key or to the named exchange, and is never declared, bound, or consumed. The endpoint exposesQueueNameandExchangeName;Queue,Exchange, andDestinationstay unset for a target outside the topology.RabbitMQMessagingTransport.TryGetDispatchEndpointmatches candidates by queue or exchange name instead of requiringDestination is RabbitMQQueue, sorabbitmq://host/vhost/q/nameandqueue:nameresolve to the endpoint created fromrabbitmq:q/name.RabbitMQRoutingStrategytoUriHelpersso both call sites share it.DiscoverTopologyand the explicit-mode guard are untouched. Nothing is added to the topology for an address-created endpoint.Behavior change
The dispatch endpoint is no longer gated by the topology at all. A configured
DispatchEndpoint("ep").ToQueue("name")under explicit binding no longer fails at startup when the queue is not declared; it publishes by name. As with every RabbitMQ publish, a message the broker cannot route is dropped. Amandatory/basic.returnhardening and a passive existence check were evaluated and deliberately left out; neither Wolverine nor the rest of Mocha verifies destinations at send time.Tests
RabbitMQDispatchEndpointTests: address-created endpoints for undeclared queues and exchanges, the topology staying empty, alias resolution across address forms, and a declaredAutoProvision(false)queue still binding to its topology resource.RabbitMQDispatchProvisioningTests: the publish goes to exchange""with the queue name as routing key, and no declare is issued.Behaviors/ExternalDestinationTests(real broker): a queue pre-created by another connection receives the send from a host that binds explicitly and declares nothing, and a send to a missing queue does not create it.Docs
routing-and-endpoints.md: documents sends to queues outside the topology and fixes the address example, which usedrabbitmq://custom-inventory-queue, a form no address parser accepts.transports/rabbitmq.md: the page claimed dispatch uses publisher confirms. The transport never enabled them, so the paragraph now states the actual behavior.Notes
All.slnx. Drop it if you prefer a strictly focused PR.