Receiving Default error queue address to "error"


(Chetan Agrawal) #1

Hi,

I am using NServiceBus 6.4.3. I am receiving the below error message for EndPointConfiguration.

Faults forwarding requires an error queue to be specified using ‘EndpointConfiguration.SendFailedMessagesTo()’

EndPointConfig Code :

var sourceQueue = "Queue";
    var storageConnectionString = "ConnectionString";
    var endpointConfiguration = new EndpointConfiguration(sourceQueue);
    var persistence = endpointConfiguration.UsePersistence<AzureStoragePersistence>();
      persistence.ConnectionString(storageConnectionString);
		endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Sagas>()
            .AssumeSecondaryIndicesExist();
        endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Subscriptions>();
        endpointConfiguration.UseSerialization<JsonSerializer>();
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.SendFailedMessagesTo("error");
        endpointConfiguration.SendOnly();
        var transport = endpointConfiguration.UseTransport<NServiceBus.AzureStorageQueueTransport>();
        transport.ConnectionString(storageConnectionString);
        endpointConfiguration.DisableFeature<TimeoutManager>();
        endpointConfiguration.UseSerialization<JsonSerializer>();
        var endpointInstance = await Endpoint.Start(endpointConfiguration)
            .ConfigureAwait(false);
        await endpointInstance.Stop()
                .ConfigureAwait(false);

(Sean Feldman) #2

Hi Chetan,

When using SendFailedMessagesTo() it instructs to send messages failed processing to the error queue. SendOnly() sets up a send-only endpoint. Those two mixed together are conflicting.

Sean


(Chetan Agrawal) #3

Hi Sean,

Even after removing “endpointConfiguration.SendOnly();” I am getting same error.

System.Exception: Faults forwarding requires an error queue to be specified using ‘EndpointConfiguration.SendFailedMessagesTo()’

Thanks,


(Andreas Öhlund) #4

What version of the NServiceBus.Azure.Transports.WindowsAzureStorageQueues package are you using?


(Andreas Öhlund) #5

Can you post the full stacktrace? (the only place in v6.4 that the ex could come from is the MSMQ transport which shouldn’t be in play here)


(Chetan Agrawal) #6

NServiceBus.Azure.Transports.WindowsAzureStorageQueues" version=“7.3.0”


(Chetan Agrawal) #7

System.Exception was unhandled
Message: An unhandled exception of type ‘System.Exception’ occurred in mscorlib.dll
Additional information: Faults forwarding requires an error queue to be specified using ‘EndpointConfiguration.SendFailedMessagesTo()’.


(Andreas Öhlund) #8

Sorry, I meant that I need the full callstack to see if the exception comes from the Msmq transport. Can you post the full callstack?


(Chetan Agrawal) #9

I have downgraded the NServiceBus from 6.4.3 to 6.0.0. Still I am receiving this error message. I am using AzureStoragePersistence

An unhandled exception of type ‘System.Exception’ occurred in mscorlib.dll

Additional information: No persistence has been selected, select a persistence by calling endpointConfiguration.UsePersistence() in the class that implements either IConfigureThisEndpoint or INeedInitialization, where T can be any of the supported persistence option. If previously using RavenDB, note that it has been moved to its own stand alone nuget ‘NServiceBus.RavenDB’. This package will need to be installed and then enabled by calling endpointConfiguration.UsePersistence().


(Andreas Öhlund) #10

Ok, this is now a different exception. Since ASQ doesn’t have native timeouts in the version you are using you need to configure timeout storage using:

endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Timeouts>();

see https://docs.particular.net/transports/azure-storage-queues/delayed-delivery

Does that help?


(Chetan Agrawal) #11

No, even after adding timeout, receiving the same error. Below is the EndPointConfig

var sourceQueue = “Queue”;
var storageConnectionString =connectionsting";
var endpointConfiguration = new EndpointConfiguration(sourceQueue);
var persistence = endpointConfiguration.UsePersistence();
persistence.ConnectionString(storageConnectionString);
endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Sagas>()
.AssumeSecondaryIndicesExist();
endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Subscriptions>();
endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Timeouts>().TimeoutDataTableName(“AzureTimeOut”).TimeoutManagerDataTableName(“AzureTimeOutManager”);
endpointConfiguration.UseSerialization();
endpointConfiguration.EnableInstallers();
endpointConfiguration.SendFailedMessagesTo(“error”);
var transport = endpointConfiguration.UseTransport<NServiceBus.AzureStorageQueueTransport>();
transport.ConnectionString(storageConnectionString);
endpointConfiguration.DisableFeature();
endpointConfiguration.UseSerialization();
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
await endpointInstance.Stop()
.ConfigureAwait(false);


(Yves Goeleven) #12

I ran the code from your original post in a clean console app and it runs just fine.

I used the following packages `from nuget

  <package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net461" />
  <package id="Microsoft.Data.Edm" version="5.7.0" targetFramework="net461" />
  <package id="Microsoft.Data.OData" version="5.7.0" targetFramework="net461" />
  <package id="Microsoft.Data.Services.Client" version="5.7.0" targetFramework="net461" />
  <package id="Newtonsoft.Json" version="10.0.1" targetFramework="net461" />
  <package id="NServiceBus" version="6.4.3" targetFramework="net461" />
  <package id="NServiceBus.Azure.Transports.WindowsAzureStorageQueues" version="7.3.0" targetFramework="net461" />
  <package id="NServiceBus.Persistence.AzureStorage" version="1.4.0" targetFramework="net461" />
  <package id="System.Spatial" version="5.7.0" targetFramework="net461" />
  <package id="WindowsAzure.Storage" version="8.0.0" targetFramework="net461" />

Can you try these versions?

If it still doesn’t work after that, can you provide us a reproduction that we can run locally?


(Chetan Agrawal) #13

Still I am receiving the error after updating with the version you have mentioned.
I am running it through NServiceBusHost. and version=“7.0.0” targetFramework=“net46”.
Below is the error message I am receiving.

2017-12-13 15:46:47.622 FATAL NServiceBus.GenericHost Exception when starting endpoint.
System.Exception: Faults forwarding requires an error queue to be specified using 'EndpointConfiguration.SendFailedMessagesTo()'
at NServiceBus.MsmqTransport.Initialize(SettingsHolder settings, String connectionString) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Transports\Msmq\MsmqTransport.cs:line 37 at NServiceBus.InitializableEndpoint.d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 49
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.GenericHost.d__1.MoveNext() in C:\Build\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 48


(Yves Goeleven) #14

There are a few things that I don’t understand, it seems to me that what you run is not the code you posted above, or there is some mixup going on.

The code above is using the self hosting technique, while the stacktrace shows that you are using the generic hosting model.

The code you showed also specifies that the transport in use is the azure storage queues transport, while the stacktrace says it is the msmq transport.

Can you share your project?

Here is the console application that I used for testing

ConsoleApp5.zip (197.5 KB)


(Chetan Agrawal) #15

Please set the project “DCKiss.Image.NSBSaga.Worker_6.0” as start project. I am using the AzureStorage.
Thanks,

DCKiss.ImageUploadSaga.zip (505.7 KB)


(Yves Goeleven) #16

You are mixing 2 hosting models, you effectively have 2 endpoints running, 1 on msmq and another on azure storage queues.

I think you want to customize the endpoint configuration provided by the generic host instead of creating a new one manually, like this:

public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
    {
        public void Customize(EndpointConfiguration configuration)
        {
            var sourceQueue = "Queue";
            var storageConnectionString = "ConnectionString";
            configuration.DefineEndpointName(sourceQueue);
            var persistence = configuration.UsePersistence<AzureStoragePersistence>();
            persistence.ConnectionString(storageConnectionString);

            configuration.UsePersistence<AzureStoragePersistence, StorageType.Sagas>().AssumeSecondaryIndicesExist();
            configuration.UsePersistence<AzureStoragePersistence, StorageType.Subscriptions>();
            configuration.UseSerialization<JsonSerializer>();
            configuration.EnableInstallers();
            configuration.SendFailedMessagesTo("error");
            var transport = configuration.UseTransport<AzureStorageQueueTransport>();
            transport.ConnectionString(storageConnectionString);
        }
    }

Note: I also removed the timeout manager configuration, this version of the storage queues transport has native delayed delivery, so you don’t need it.