1
votes

I created a new NServiceBus for an azure worker role.

The configuration is simply:

NServiceBus.Configure.With(busAssemblies)
                        .Log4Net()
                        .License(Config.Default.NServiceBus_License)
                        .DefineEndpointName(endPointName) 
                        .UnityBuilder(serviceBusDiConfiguration.Container)
                        .AzureConfigurationSource()
                        .AzureSagaPersister()
                        .AzureSubcriptionStorage()
                        .AzureDataBus()
                        .JsonSerializer()
                        .AzureServiceBusMessageQueue()
                        .UnicastBus()
                        .LoadMessageHandlers()
                        .CreateBus()
                        .Start()

The client configuration is identical to the above except for the addition call to .DoNotAutoSubscribe(). The client then uses Bus.Send(message) to the input queue of the listener.

Azure Bus Queue reported messages being sent into the input queue and removed accordingly (with the listeners running - and not otherwise). So yes- messages are being removed from the queue. However my handlers are not being fired, and there is no error message in either the event viewers or console (when using dev fabric).

enter image description here

The only error and I don't even think it's relevant because it's not being logged at the time the message was removed from the queue - rather it was logging this at start up time, but the error is as follow:

[MonAgentHost] Error: MA EVENT: 2013-05-12T22:52:54.925Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     12084
[MonAgentHost] Error:     6180
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     880e569e-d37b-4262-bdae-dbe5133
[MonAgentHost] Error:     netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)

This is driving me crazy. I can't believe someone actually designed the API to be this complicated and opaque - it makes Windows Complication Foundation seems trivial in comparison. Please help me figure out what went wrong, any hint is appreciated, eg. look in this file/folder for error logs will work too!

Thanks!

1
Is your message handler type in one of the assemblies you pass as "busAssemblies" ?Udi Dahan
Udi, thanks for responding. There is an exception somewhere, but it's being swallowed. I decompiled the binary and was able to see the message received and deserialized. It was even able to select the proper handler, but then something went wrong. But yes, the right assemblies are being loaded. I am still investigating what it is - will update thread when I have more info. Something is swallowing up the exception when it shouldn't - and debugging a compiled code is a chore.Alwyn
Alwyn, did you figure out what went wrong here?Yves Goeleven
Yes, if you've an error thrown from inside a custom Unit of Work, your exception will not be logged properly. Instead it will be so mangled, that you think its coming from your transport pipeline.Alwyn
Not sure why did you need to decompile anything, I use NSB source code when I get this sort of issues.Alexey Zimarev

1 Answers

0
votes

I had the same problem recently, there was an issue with AzureServiceBus transport when you define your own endpoint name and host locally (not in Azure worker role) it does not work. I has been recently fixed by Yves but I used a workaround to specify full endpoint name (including service URL) in the app.config section for Azure ServiceBus transport.

  <configSections>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
<section name="AzureServiceBusQueueConfig" type="NServiceBus.Config.AzureServiceBusQueueConfig, NServiceBus.Azure" />
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<section name="Logging" type="NServiceBus.Config.Logging, NServiceBus.Core" />
  </configSections>

 <AzureServiceBusQueueConfig QueueName="[email protected]" ConnectionString="Endpoint=sb://mynamespace.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=mysecret" />