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

Unable to provide destination machine/site for subscriptions registered via bridge.RegisterPublisher #36

Open
karolus888 opened this issue Sep 4, 2020 · 1 comment

Comments

@karolus888
Copy link

karolus888 commented Sep 4, 2020

Hi Szymon,

We have encountered the problem when trying to register MSMQ publisher which is located on different physical machine than the Router we connect to.
On the client side we have the following code:
var routing = c.UseTransport<RabbitMQTransport>().Routing(); var bridge = routing.ConnectToRouter("Router"); bridge.RegisterPublisher(typeof(SubscribedEvent), "Endpoint");

which leads to following errors in "Router" logs:
NServiceBus.Unicast.Queuing.QueueNotFoundException: Failed to send message to address: [Endpoint@ROUTER-HOST] ---> System.Messaging.MessageQueueException: The queue does not exist or you do not have sufficient permissions to perform the operation.
and, of course, the queue doesn't exist at ROUTER-HOST, we would like to send subscription to Endpoint@ANOTHER-HOST.

I suppose that this kind of routing should be done on client (connector) side, i.e. by specyfing "NServiceBus.Bridge.DestinationSites" header but this doesn't seem to be supported, looking at RouterSubscribeBehavior,

Could you please provide some guidelines how this kind of subscription routing can be achieved?

@SzymonPobiega
Copy link
Owner

Hi

You are right, the machine where the publisher is needs to be specified. Currently the only way to do it is on the Router. Take a look at this sample that shows how the EndpointInstances routing extensibility point can be used for this purpose.

There is no way to specify the publisher machine in the subscriber code. The reason for this is the subscriber should not have to know which transport is used on the other side of the router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants