1

I have NServiceBus running in a single process, but I would like to send Message A, but receive only Message B. However, I think because Message Endpoint Mappings are used for both sending and receiving, the process is trying to handle both messages - A and B. Any way around this issue? Both messages go onto the same queue, based on the fact that a single process can only listen to a single queue NSB limitation.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Sergey Barskiy
  • 1,761
  • 2
  • 15
  • 17
  • I think more info is needed to be able to help. Are these commands or events? Are A and B different message *types*? Do you have a handler for Message A in your process, and if not, what do you mean that your process is receiving it? – Phil Sandler Nov 01 '13 at 19:30
  • A and B are different .NET types,s some commands some events, the problem exists in all cases. I have handlers loaded for just Message B, since I receive only , and send only A. So, when my A message is received, I get "no handler is registered" – Sergey Barskiy Nov 01 '13 at 19:36
  • 1
    Take a look at: http://stackoverflow.com/questions/12283490/nservicebus-warning-no-handlers-could-be-found-for-message-type – Phil Sandler Nov 01 '13 at 20:42
  • Can you share the code and the config you have? to what endpoint are you sending message A? can you describe the use case a bit more please? – Sean Farmar Nov 02 '13 at 12:13
  • Phil's link is correct. It speaks to another limitation - single process can only listen to a single queue. This limitation is what led me to the current question. – Sergey Barskiy Nov 04 '13 at 14:08
  • I do not have config files - all configuration is done in code to promote central management of all configuration. – Sergey Barskiy Nov 04 '13 at 14:10
  • A little more on use case. I am now using Send() overload that takes destination as a paramater, so I can derive the destination based on bus instance configuration. In other words, the code looks like the following. Is (this.Mode = ModeA) this.Bus>Send(destinationForModeA, message). I configure input queue in code as well using Condfigure.DegineEndpointName(determineBasedOnModeEndoiintName). I got the demo to work, but I feel that it took a lot more effort than it should because I cannot listen to multiple endpoints from single instance and filter messages for each endpoint. – Sergey Barskiy Nov 04 '13 at 14:16

1 Answers1

0

You could use two different AppDomains.

The statement

a single process can only listen to a single queue

Is not actually correct. It is more correct to say

a single appdomain can only listen to a single queue

Since you can have multiple appdomains per process you could have a since processes listening to multiple queues

Simon
  • 33,714
  • 21
  • 133
  • 202