1
votes

I have implemented a small sample project based on the AzureServiceBusFullDuplex sample from NServiceBus package (3.2.8) with a small difference - I have the listener in the cloud and sender on premises. It works OK until I run two on-premises endpoints. When I do that and second enapoint sends a message, reply is received by the first endpoint. When I initiate a third endpoint and it sends a message, reply is received by the second endpoint.

Logically I understand what happens, every endpoint gets subscribed to the reply message contract and the latest registered endpoint received all messages of that type. But how than could I implement my scenario when I have multiple senders of the same message type with only one handler in the cloud? It is something similar to sessions support in native Azure Service Bus queues.

2

2 Answers

2
votes

Alexey,

sounds like the on premise endpoints are configured with the same input queue and first one to pick up the reply gets it, can you validate this and make sure they all listen on different queues?

Kind regards, Yves

1
votes

So I completed my prototype using
1) No queue name specified in the AzureServiceBusQueueConfig
2) Specifying a queue name in the code

                _configure = Configure.With()
           .DefaultBuilder()
           .Log4Net(new log4net.Appender.ColoredConsoleAppender())
           .JsonSerializer()
           .DefineEndpointName(queueName)
           .AzureServiceBusMessageQueue()
           .IsTransactional(false)
           .MessageForwardingInCaseOfFault()
           .UseInMemoryTimeoutPersister()
           .DisableSecondLevelRetries()
           .InMemorySubscriptionStorage()
           .UnicastBus()
               .DoNotAutoSubscribe()
               .LoadMessageHandlers()
           .CreateBus();

In the AzureServiceBusQueueConfig.cs I found that it uses an endpoint name as a queue name and if no queue name is configured, endpoint name that comes from the preceding configuration call is used.