1

I have an on premise service bus that is configured to handle messages from an azure queue. The problem i am having is that the host is reporting an msmq error saying that it could not create the error queue. Aside from the fact that it should not be using msmq, it also handles the messages with no problems despite the error so it does not seem to be critical.

My Host is running as a class library configured to start with the nservicebus.host.exe process.

Here is my host code and config:

internal class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
{
    #region IWantCustomInitialization Members

    public void Init()
    {
        Configure.With()
            .DefaultBuilder()
            .AzureMessageQueue()
            .JsonSerializer()
            .UnicastBus()
            .IsTransactional(true)
            .InMemorySubscriptionStorage();
    }

    #endregion
}

Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
    <section name="AzureQueueConfig" type="NServiceBus.Config.AzureQueueConfig, NServiceBus.Azure"/>
    <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
  </configSections>

  <MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
  <AzureQueueConfig QueueName="sender" ConnectionString="UseDevelopmentStorage=true" PeekInterval="5000" MaximumWaitTimeWhenIdle="60000" />

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedruntime version="v4.0" />
    <requiredruntime version="v4.0.20506" />
  </startup>
</configuration>

And Here is the actual Error Message:

2012-04-24 07:57:10,973 [1] ERROR NServiceBus.Utils.MsmqUtilities [(null)] <(nul l)> - Could not create queue error@UseDevelopmentStorage=true or check its exist ence. Processing will still continue. System.Messaging.MessageQueueException (0x80004005): Message Queue service is no t available. at System.Messaging.MessageQueue.Create(String path, Boolean transactional) at NServiceBus.Utils.MsmqUtilities.CreateQueue(String queueName, String accou nt) at NServiceBus.Utils.MsmqUtilities.CreateQueueIfNecessary(Address address, St ring account)

EDIT: Adding .MessageForwardingInCaseOfFault() to the initialization corrected the issue.

chutch
  • 173
  • 3
  • 12

2 Answers2

1

Looks like AsA_Server assumes msmq, guess you'll have to configure the process manually

Yves Goeleven
  • 2,185
  • 15
  • 13
  • Adding .MessageForwardingInCaseOfFault() resolved the issue. Not sure why though as this is not required if i host within a console application (as opposed to using nservicebus.host.exe). thanks – chutch Apr 24 '12 at 21:43
1

Adding .MessageForwardingInCaseOfFault() to the init method resolved the issue. Still feels like there is an underlying bug, but it is working.

I suspect that below described the next hurdle (not handling errors correctly) but i will have to try to force a failed message to verify.

As described in: NServiceBus error queues in Azure

Community
  • 1
  • 1
chutch
  • 173
  • 3
  • 12
  • There are 2 things to keep in mind for the error handling, 1. naming the queue correctly according to the infrastructures naming guidelines, 2. create the queue manually as nsb does only create queues that it listens on and not destionation queues – Yves Goeleven Apr 25 '12 at 10:52
  • And I'll also look into the message forwarding requirement, that shouldn't be the case... – Yves Goeleven Apr 25 '12 at 10:54