0
votes

I have pre provisioned an Azure Subscription using a custom fitler for my NServiceBus endpoint to connect to.

Filter = [NServiceBus.EnclosedMessageTypes] LIKE '%ContractName%' AND Property = 'true'

I receive the following critical error from NServiceBus:

Looks like this subscriptionname is already taken by another logical endpoint as the sql filter does not match the subscribed eventtype, please choose a different subscription name!

NServiceBus will add its own rule which is a more verbose version of what I have around the contract name.

Even if I add the exact same filter that NServiceBus would create if the subscription didn't previously exist and add my custom filter, it still complains.

Filter = <generated by NServiceBus> AND Property = 'true'

The custom property filter is to prevent the subscription getting messages it doesn't care about from a busy topic and causing unnecessary processing to ignore them.

Does anyone know if I can tell NServiceBus that the filter is ok and it can proceed?

I'm using NServiceBus 4.6.5 and NServiceBus.Azure 5.3.5

1
What's the subscription name you're creating?Sean Feldman

1 Answers

2
votes

The exception is raised when

  1. A subscription with a given name already exists for a given topic (link)
  2. SQL filter for subscription is different from the one generated by NSB (link)

A subscription name is an event name. If you happened to have a Default event, that will be an issue. Try renaming your custom subscription to something that is not colliding with an event name. That way you'll be able to have a subscription with your custom rules. In case you need the part of the filter created by NSB, you can leverage ServicebusSubscriptionFilterBuilder for that.

Side note, you're on NSB 4.6.5. Support for version 4.x has expired this month. You might want to look into upgrading your version.