SzymonPobiega / NServiceBus.Router

Cross-transport, cross-site and possibly cross-cloud router component for NServiceBus
MIT License
5 stars 10 forks source link

ASB subscription/rule name shortener preventing subscription requests through NServiceBus Router #25

Closed pihalve closed 4 years ago

pihalve commented 4 years ago

I’ve created an MSMQ based Publisher that can publish event messages to an Azure Service Bus based Subscriber. I order to accomplish this, I’ve implemented NServiceBus.Router into the publisher (running in same process). This works fine. Subscriber can send subscription request and publisher stores it in subscription storage as originating from router. Publisher can publish event messages to subscriber.

However, for subscriptions where subscription/rule name exceeds 50 characters, at which point the name shorteners kicks in, then the subscription request is not picked up by the publisher, and it is not stored in subscription storage, which means publisher cannot publish event messages for that type.

Any way to fix this?

SzymonPobiega commented 4 years ago

@pihalve which topology are you using in the ASB transport?

pihalve commented 4 years ago

It is the forwarding topology. It is my understanding that this is the only one supported. Well at least in the newest version of NServiceBus.Transport.AzureServiceBus. Basically I use newest versions of all packages involved.

SzymonPobiega commented 4 years ago

Thnaks. I'll try to repro this in an acceptance test and see what can be done.

SzymonPobiega commented 4 years ago

In https://github.com/SzymonPobiega/NServiceBus.Router/commit/5ff75c6168123e6a35d1b736638a001a1877df86 I added an acceptance test as an attempt to repro the issue but it seems to work fine. I am using the forwarding topology with sanitization enabled. The name of the subscription is based on a hash but the event is still delivered. I am probably missing something. Can you create a PR with modifications required to break it? Then I should be able to fix it.

pihalve commented 4 years ago

I finally found the problem. You are right, it works fine :) For some reason I forgot a call to RegisterPublisher() for that specific event message type in the subscriber. I guess I was too focused on the name shortening to notice this. Sorry for the inconvenience.

SzymonPobiega commented 4 years ago

@pihalve No problem! That test is a good addition anyway :-)