chutch
chutch

Reputation: 173

nservicebus using generic host with azure queues causes msmq error

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.

Upvotes: 1

Views: 570

Answers (2)

chutch
chutch

Reputation: 173

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

Upvotes: 1

Yves Goeleven
Yves Goeleven

Reputation: 2185

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

Upvotes: 1

Related Questions