SzymonPobiega / NServiceBus.Router

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

SQS events not handled by AzureServiceBus #41

Closed ngallegos closed 3 years ago

ngallegos commented 3 years ago

I'm working on getting a router set up so that a new SqsTransport endpoint can interact with some AzureServiceBusTransport endpoints. I'm not sure what I'm doing wrong, but so far I can only successfully send a command across the router from an ASB endpoint and have it handled by the SQS endpoint. When the SQS endpoint publishes an event, the ASB endpoint never handles it.

Rather than post all of the code, here's a repo you can clone to reproduce the issue

As far as I can tell, there are no errors, so I think I'm just missing something or registering the publisher incorrectly.

I'm running .NET Core 5.0 worker apps using:

ngallegos commented 3 years ago

Documenting here in case anyone stumbles on this. The fix is to add

settings.Set("NServiceBus.AmazonSQS.DisableSubscribeBatchingOnStart", true);

to the SQS config in the router. Thanks to @SzymonPobiega , for figuring this out on Stack Overflow

SzymonPobiega commented 3 years ago

I just released Router 3.9.1 which requires NServiceBus.Raw 3.2.4. That version of NServiceBus.Raw adds a bunch of hacks required by various transports. My testing shows that the Router should not work without any additional config hacks on Azure ServiceBus, Azure Storage Queues (defaults to Json envelope serialization), SQS, MSMQ and RabbitMQ.

ngallegos commented 3 years ago

That's even better. I gave it a try and it looks good. Thanks for looking into this!