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

LegacyV3NameFormatter.FormatQueueName is not compatibe with Rebus up to 6.0.3 #56

Open
gaevoy opened this issue Jun 5, 2020 · 3 comments

Comments

@gaevoy
Copy link

gaevoy commented Jun 5, 2020

LegacyV3NameFormatter.FormatQueueName is not compatible with naming convention of Rebus up to 6.0.3. Same goes to LegacyNameFormatter.

Also it would be nice to specify a version using .UseLegacyNaming(), for instance .UseLegacyNaming(RebusVersion.V6) or .UseLegacyNaming(RebusVersion.V3)

Before 7.x

Queue name: Foo-BAR-1 -> foo-bar-1
https://github.com/rebus-org/Rebus.AzureServiceBus/blob/6.0.7/Rebus.AzureServiceBus/AzureServiceBus/AzureServiceBusTransport.cs#L76

After 7.x

Queue name: Foo-BAR-1 -> foo_bar_1
https://github.com/rebus-org/Rebus.AzureServiceBus/blob/7.1.3/Rebus.AzureServiceBus/AzureServiceBus/AzureServiceBusTransport.cs#L101
https://github.com/rebus-org/Rebus.AzureServiceBus/blob/7.1.3/Rebus.AzureServiceBus/AzureServiceBus/NameFormat/LegacyV3NameFormatter.cs#L14-L22

Workaround

public class LegacyV3NameFormatterFixed : INameFormatter
{
    private static readonly LegacyV3NameFormatter Original = new LegacyV3NameFormatter();

    public string FormatQueueName(string queueName)
    {
        return queueName.ToLowerInvariant();
    }

    public string FormatSubscriptionName(string subscriptionName)
    {
        return Original.FormatSubscriptionName(subscriptionName);
    }

    public string FormatTopicName(string topicName)
    {
        return Original.FormatTopicName(topicName);
    }
}
// boot logic
_activator = new BuiltinHandlerActivator();
Configure.With(_activator)
.Transport(t => t.UseAzureServiceBusAsOneWayClient("...").UseLegacyNaming())
.Options(o => o.Decorate<INameFormatter>(_ => new LegacyV3NameFormatterFixed()))
.Start();
@mookid8000
Copy link
Member

Hi @gaevoy , but.... my memory might be failing me, but I think the point of "legacy naming" with Rebus' Azure Service Bus transport v7 is to emulate the naming of v6, including its tendency to be overly conservative with queue names.

It shouldn't have any relation to the version of Rebus you're using, so if that's the case for you, then that's something we'll need to investigate...

@gaevoy
Copy link
Author

gaevoy commented Jun 8, 2020

It shouldn't have any relation to the version of Rebus you're using

Right. I mean version of Rebus.AzureServiceBus. So main issue it is not backward compatible with previous version.

I guess, it is okay but should be easy way how to configure it.

@mookid8000
Copy link
Member

Hmm.... I must admit I'm very hesitant to make additional changes regarding naming, because we've made such a mess already 😁 I'm afraid I'll make things even more confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants