Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageForwardingInCaseOfFaultConfig should not be required for sendonly #2555

Closed
outofcoolnames opened this issue Nov 3, 2014 · 2 comments
Labels
Milestone

Comments

@outofcoolnames
Copy link

When configuring an endpoint as a SendOnly endpoint, in version 5.0.x the user didn't have to define the MessageForwardingInCaseOfFaultConfig configuration. However in 5.1.0 this is now required and the endpoint fails to start unless it is specified.

Steps to repro

  • Create a console application and install-package NServiceBus (version 5.0.0)
  • Add the following to configure it as send-only
 static void Main(string[] args)
 {
    var busConfiguration = new BusConfiguration();
    busConfiguration.EndpointName("Sample.SendOnly.Client");
    busConfiguration.UseSerialization<JsonSerializer>();
    busConfiguration.UsePersistence<InMemoryPersistence>();
    busConfiguration.EnableInstallers();

    var bus = Bus.CreateSendOnly(busConfiguration);
    Console.ReadLine();
}
  • Upgrade this endpoint to 5.1.0 and notice the configuration error

Workaround
Either add the config section, MessageForwardingInCaseOfFaultConfig to app.config or if you don't want to change the app.config, please add the following initialization via code.

using NServiceBus.Config;
using NServiceBus.Config.ConfigurationSource;

class ConfigErrorQueue : IProvideConfiguration<MessageForwardingInCaseOfFaultConfig>
{
    public MessageForwardingInCaseOfFaultConfig GetConfiguration()
    {
        return new MessageForwardingInCaseOfFaultConfig
        {
            ErrorQueue = "error"
        };
    }
}

Hi,

I upgraded from NSB 5.0.1 to 5.1.0 today and now in my WCF web service I'm getting an error stating: Faults forwarding requires an error queue to be specified. Please add a 'MessageForwardingInCaseOfFaultConfig' section to your app.config

This wasn't required on 5.0.1. This is the entire message:

System.Configuration.ConfigurationErrorsException occurred
HResult=-2146232062
Message=Faults forwarding requires an error queue to be specified. Please add a 'MessageForwardingInCaseOfFaultConfig' section to your app.config
or configure a global one using the powershell command: Set-NServiceBusLocalMachineSettings -ErrorQueue {address of error queue}
Source=NServiceBus.Core
BareMessage=Faults forwarding requires an error queue to be specified. Please add a 'MessageForwardingInCaseOfFaultConfig' section to your app.config
or configure a global one using the powershell command: Set-NServiceBusLocalMachineSettings -ErrorQueue {address of error queue}
Line=0
StackTrace:
at NServiceBus.Faults.ErrorQueueSettings.GetConfiguredErrorQueue(ReadOnlySettings settings) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Faults\ErrorQueueSettings.cs:line 42

InnerException:

I don't have any issue with adding the configuration to the web.config but I normally prefer to avoid making web.config changes if I can
To reproduce:
Create WCF Service Application, install NSB version 5.0.1(along with NServiceBus.Log4Net and its dependent log4net package)
Add Global.asax
Create ISendOnlyBus Bus within Application_Start
Call Bus.Send within WCF service class <-- builds and runs without issue
Then...
Upgrade to NSB 5.1.0 (the latest at the time of writing)
Observe the error above

@indualagarsamy
Copy link
Contributor

@outofcoolnames - I was able to reproduce this. I've updated the issue description and I have added a workaround to provide config via code, until we fix this.

@indualagarsamy
Copy link
Contributor

@SimonCropp -
In v5.0.3 - this was initialization was as follows:
https://github.com/Particular/NServiceBus/blob/5.0.3/src/NServiceBus.Core/Transports/Msmq/Config/MsmqTransportConfigurator.cs#L28
In v5.1.0 - it was changed to include the error queue as follows:
https://github.com/Particular/NServiceBus/blob/5.1.0/src/NServiceBus.Core/Transports/Msmq/Config/MsmqTransportConfigurator.cs#L30-31
and it was due to trying to fix this: 4ee392f
Since the ForwarderFaultManager is a feature, I am thinking we can disable that if its SendOnly - thoughts?

@johnsimons johnsimons added this to the 5.1.1 milestone Nov 3, 2014
@SimonCropp SimonCropp changed the title MessageForwardingInCaseOfFaultConfig now required MessageForwardingInCaseOfFaultConfig should not be required for sendonly Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants