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

Update docs on MSMQ bridge specifics #6812

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Snippets/Bridge/Bridge_2/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ public void QueueName()
#region custom-address

var transport = new BridgeTransport(new MsmqTransport());
transport.HasEndpoint("Finance", "finance_queue_name");
transport.HasEndpoint("Finance", "finance@machinename");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should keep both examples:

  1. Where the endpoint is on a different machine => finance@machinename
  2. Where the queue name is different due to https://docs.particular.net/nservicebus/endpoints/specify-endpoint-name#input-queue being used? => finance_queue_name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And perhaps spell out that 1 is MSMQ specific and that 2 applies to all transports?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where the queue name is different due to https://docs.particular.net/nservicebus/endpoints/specify-endpoint-name#input-queue being used? => finance_queue_name

I've realized that my statement here is wrong, the address override should only be used to control where messages get dispatched to and where subscription messages are sent.

To control the name of the queue that the bridge reads from the endpoint name has to be adjusted since that is what we pass into the raw endpoint that does the reading.

https://github.com/Particular/NServiceBus.MessagingBridge/blob/master/src/NServiceBus.MessagingBridge/EndpointProxyFactory.cs#L28

In short: The text in this PR is ok even though I'm not sure if "machinename" is better than "another-machine"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought perhaps this PR is no longer relevant since we fixed it so that you can specify the machine name in the queue address, and we decided that just specifying a queue name isn't really supported?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, so we can close this PR


var endpoint = new BridgeEndpoint("Sales", "sales_queue_name");
var endpoint = new BridgeEndpoint("Sales", "sales@machinename");
transport.HasEndpoint(endpoint);

#endregion
Expand Down
4 changes: 2 additions & 2 deletions Snippets/Bridge/Bridge_3/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ public void QueueName()
#region custom-address

var transport = new BridgeTransport(new MsmqTransport());
transport.HasEndpoint("Finance", "finance_queue_name");
transport.HasEndpoint("Finance", "finance@machinename");

var endpoint = new BridgeEndpoint("Sales", "sales_queue_name");
var endpoint = new BridgeEndpoint("Sales", "sales@machinename");
transport.HasEndpoint(endpoint);

#endregion
Expand Down
4 changes: 2 additions & 2 deletions Snippets/Bridge/TransportBridge_1/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ public void QueueName()
#region custom-address

var transport = new BridgeTransport(new MsmqTransport());
transport.HasEndpoint("Finance", "finance_queue_name");
transport.HasEndpoint("Finance", "finance@machinename");

var endpoint = new BridgeEndpoint("Sales", "sales_queue_name");
var endpoint = new BridgeEndpoint("Sales", "sales@machinename");
transport.HasEndpoint(endpoint);

#endregion
Expand Down
3 changes: 3 additions & 0 deletions nservicebus/bridge/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ The "Sales" queue on the MSMQ transport and the "Billing" queue on the AzureServ

The bridge provides the ability to change the address of the queue of incoming messages.

> [!NOTE]
> When forwarding messages to non-proxied MSMQ endpoints that run on different servers than the bridge, the addresses of the queues that messages should be forwarded to _must_ be provided.

snippet: custom-address

## Recoverability
Expand Down
2 changes: 1 addition & 1 deletion samples/bridge/azure-service-bus-msmq-bridge/sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ snippet: asb-bridge-configuration
The MSMQ bridge endpoint is configured by using the name of the actual MSMQ endpoint where the message needs to be routed to:

> [!NOTE]
> [Endpoints cannot read from remote MSMQ queues](/transports/msmq/#remote-queues), hence when forwarding messages to/from MSMQ endpoints, the bridge must be configured on each MSMQ server.
> [Endpoints cannot read from remote MSMQ queues](/transports/msmq/#remote-queues), hence when reading messages from proxied MSMQ endpoints, the bridge must be configured on each MSMQ server that contains the proxy queues.

snippet: create-msmq-endpoint-of-bridge

Expand Down