Another question on the topic is Using NServiceBus with an Asp.Net MVC 2 stream . Udi replied that the following method can be used if we really want to do this.
var sync = Bus.Send<SomeMessage>()
.Register((AsyncCallback)delegate(IAsyncResult ar)
{
var result = ar.AsyncState as CompletionResult;
},
null
);
sync.AsyncWaitHandle.WaitOne( );
This works great in a Windows application because there is only one user.
I wonder how this will work in a web application; since there are multiple threads (for multiple user sessions), call Bus.Send and expect a callback. There will be only one queue of answers (if my understanding is correct).
Does NServiceBus know which thread to resume based on the received response from the queue?
, ( - , )
", , GetCustomersByRegionRequest CustomersByRegionResponse, ".
- http://docs.particular.net/