views:

184

answers:

2

Hello,

I created a simple web application where a search form is filled out, submit button clicked, and a message is sent with the search parameters via nServiceBus. I also have a handler in the same project that picks up the message (from the same queue). For some reason, the web server process blocks until after the message is picked up, is there any reason for this? I set a breakpoint in the message handler and it breaks before the request finishes... locking the browser until I allow the code to continue. I would expect control to return to the browser regardless of when the handler gets fired...

Thanks, D.Niemeyer

A: 

Are you using .RegisterWebCallback() in your code, as that is what is responsible for preventing ASP.NET to complete the HTTP call?

Udi Dahan
Hi Udi,No I am not calling RegisterWebCallback() anywhere, just IBus.Send, with a message handler, in an MVC application. Send looks like this:bus.Send<SearchMessage>(m => m.Message = "test");Handler looks like this (as simple as I could make this test):public class SearchMessageHandler : IHandleMessages<SearchMessage>{ public void Handle(SearchMessage message) { string s = message.Message; }}
Dale Niemeyer
+1  A: 

This was answered in the nServiceBus forum. This is a phenomenon caused by having the debugger attached, which stops all threads if a breakpoint is hit before the response is returned. Placing a sleep in the handler demonstrates this.

Dale Niemeyer